Project

General

Profile

Bug #2141

Trends grahs issue

Added by Romain Vrignaud over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Trends
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

The screenshot is worth a thousand words.

funny-trends.png View funny-trends.png 66.7 KB Romain Vrignaud, 01/17/2013 11:01 AM
trends.source trends.source 10.5 KB Romain Vrignaud, 01/18/2013 02:21 AM
Funny trends

Associated revisions

Revision 30bcb145 (diff)
Added by Ohad Levy over 9 years ago

fixes #2141 - Trends grahs issue

Revision 0d264ea7 (diff)
Added by Robert Birnie over 9 years ago

Fixes #2141 - Deletes duplicate TrendCounters

This fixes graphs with spikes, caused by multiple rake trends:counter tasks.

Revision f21afe9d (diff)
Added by Ohad Levy over 9 years ago

refs #2141 - ensures no duplicate trends are created

History

#1 Updated by Ohad Levy over 9 years ago

  • Assignee set to Robert Birnie

#2 Updated by Robert Birnie over 9 years ago

Can you provide the page's source? There must be something funky in how it is building the array the graph uses.

#3 Updated by Romain Vrignaud over 9 years ago

See attached

I have that behavior in all my trends.

#4 Updated by Ohad Levy over 9 years ago

  • Assignee changed from Robert Birnie to Ohad Levy
  • Target version set to 1.1

This is a ordering issue (where the JSON is not sorted by time).

I'm attaching a fix, but I'm unable to confirm it works (as I can't reproduce locally).

Please reopen if required.

#5 Updated by Ohad Levy over 9 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

#6 Updated by Robert Birnie over 9 years ago

  • Status changed from Closed to Assigned
  • % Done changed from 100 to 50

This doesn't seem to fix it.

http://grab.by/jsVw

#7 Updated by Ohad Levy over 9 years ago

hmm.. since i don't have the data set to try and replicate it, can you try playing around with the queries used, from past experience, its usually a non sorted data set, which confuses highcharts.

#8 Updated by Robert Birnie over 9 years ago

Both my page and his has duplicates in the data. I'll go look through my database and see if there are duplicates there too or if the array is getting made poorly.

[1358420109000,1],[1358420109000,1]

#9 Updated by Robert Birnie over 9 years ago

Dupes in DB too
#<TrendCounter id: 744206, trend_id: 3, count: 287, created_at: "2013-01-30 09:00:10", updated_at: "2013-01-30 09:00:10">,
#<TrendCounter id: 744317, trend_id: 3, count: 287, created_at: "2013-01-30 09:00:10", updated_at: "2013-01-30 09:00:11">,

#10 Updated by Sam Kottler over 9 years ago

Robert just said in IRC that he was able to fix the issue by removing a duplicate cronjob. Can you confirm there is only on cronjob installed to run the task?

#11 Updated by Robert Birnie over 9 years ago

Romain,

Check for duplicate cronjobs. Foreman auto creates ones now in /etc/cron.d/foreman

I also create a rake task to clean up duplicates so you can easily fix this.

https://github.com/theforeman/foreman/pull/396

#12 Updated by Ohad Levy over 9 years ago

Robert Birnie wrote:

Romain,

Check for duplicate cronjobs. Foreman auto creates ones now in /etc/cron.d/foreman

I also create a rake task to clean up duplicates so you can easily fix this.

https://github.com/theforeman/foreman/pull/396

does it mean we miss a validation on foreman side? we can ensure that duplicated data is not imported regardless if you have multiple cronjobs?

#13 Updated by Robert Birnie over 9 years ago

I guess we could do an ensure unique based on created_at and trend_id.

If we did it through the model, how would we notify the user of the issue to be rectified? Crazy graphs are a pretty good notification. :D

#14 Updated by Ohad Levy over 9 years ago

Robert Birnie wrote:

I guess we could do an ensure unique based on created_at and trend_id.

First of all, we would ensure that the data is accurate, imho thats more important.

If we did it through the model, how would we notify the user of the issue to be rectified? Crazy graphs are a pretty good notification. :D

Secondly, we could / should log the error to the log, and in theory create a notice (we have a notice model), but even if you alert, you might end up having multiple alerts.

I would say, since this is an edge case (mis configuration) then, I would alert to the log and thats it?

#15 Updated by Robert Birnie over 9 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 50 to 100

Also available in: Atom PDF