ac3cloud / pigeonhole

A PagerDuty visualisation and categorisation tool
MIT License
28 stars 8 forks source link

Line graph for number of alerts per 1 hour is incorrect #26

Closed Sarah-E-Greene closed 9 years ago

Sarah-E-Greene commented 9 years ago

As shown below, the line graph keeps dropping to 0 for every point, even though there's non-zero data for every point.

screen shot 2015-05-14 at 7 27 57 pm

nerdyness commented 9 years ago

I just browsed to pigeonhole and it looks as expected. screenshot-pigeonhole - mozilla firefox

Selecting yesterday && today as the date range changed this to the broken graph. screenshot-pigeonhole - mozilla firefox-1

Looking a bit further now.

nerdyness commented 9 years ago

Looking at @series here, if I load one day I get:

"[{\"name\":\"Number of alerts per 1h\",\"data\":[[1431612000000,0],[1431615600000,0],[1431619200000,4],[1431622800000,2]...

If I load more than one day the data contains 2 values for each timestamp: "0" and then the actual value:

"[{\"name\":\"Number of alerts per 1h\",\"data\"[[1431525600000,0],[1431525600000,3],[1431529200000,0],[1431529200000,4],[1431532800000,0],[1431532800000,2]:(..)[1431615600000,0],[1431615600000,0],[1431619200000,0],[1431619200000,4],(..)
nerdyness commented 9 years ago

Turns out influxdb returns the data we display:

:count=>[{"time"=>1431565200, "count"=>19}, {"time"=>1431561600, "count"=>18},(..),{"time"=>1431561600, "count"=>0}, {"time"=>1431565200, "count"=>0},(..)
nerdyness commented 9 years ago

I can't even.

select count(incident_key) from pigeonhole where time > 1431525600s and time < 1431662482s group by time(1h) fill(0) returns duplicates, while select count(incident_key) from pigeonhole group by time(1h), fill(0) where time > 1431525600s and time < 1431662421s doesn't.

Looking at the query language the latter is the preferred syntax. PR coming up.

nerdyness commented 9 years ago

https://github.com/influxdb/influxdb/issues/2583