Project

General

Profile

Actions

Bug #2141

closed

Trends grahs issue

Added by Romain Vrignaud about 11 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Trends
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

The screenshot is worth a thousand words.


Files

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
Actions #1

Updated by Ohad Levy about 11 years ago

  • Assignee set to Robert Birnie
Actions #2

Updated by Robert Birnie about 11 years ago

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

Actions #3

Updated by Romain Vrignaud about 11 years ago

See attached

I have that behavior in all my trends.

Actions #4

Updated by Ohad Levy about 11 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.

Actions #5

Updated by Ohad Levy about 11 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
Actions #6

Updated by Robert Birnie about 11 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

Actions #7

Updated by Ohad Levy about 11 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.

Actions #8

Updated by Robert Birnie about 11 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]

Actions #9

Updated by Robert Birnie about 11 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">,

Actions #10

Updated by Sam Kottler about 11 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?

Actions #11

Updated by Robert Birnie about 11 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

Actions #12

Updated by Ohad Levy about 11 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?

Actions #13

Updated by Robert Birnie about 11 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

Actions #14

Updated by Ohad Levy about 11 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?

Actions #15

Updated by Robert Birnie about 11 years ago

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

Also available in: Atom PDF