Inconsistent results from summarize

Asked by Jase Wells

I am fetching JSON data from Graphite to show total page views, using summarize to get hourly or daily totals. I've noticed that sometimes the data fetched is way off, then it goes back to normal. To reproduce the problem, I created a test query string to fetch the same data twice:

http://graphite/render/?format=json&from=-1d&target=summarize(sum(stats.counters.prod.main.view.app.*.*.count),'1d')&target=summarize(sum(stats.counters.prod.main.view.app.*.*.count),'1d')

I would expect the two targets to produce the same result, and often it's the same or very close. (Maybe in the milliseconds it takes to calculate the first result, a few extra counts get added?) But then sometimes it's out of whack like this:

[{"target": "summarize(sumSeries(stats.counters.prod.main.view.app.*.*.count), \"1d\", \"sum\")", "datapoints": [[2167.6833333333311, 1360713600], [64.666666666666657, 1360800000]]}, {"target": "summarize(sumSeries(stats.counters.prod.main.view.app.*.*.count), \"1d\", \"sum\")", "datapoints": [[4390.0, 1360713600], [93.0, 1360800000]]}]

Am I wrong to think the same target should produce the same result? The one that's out of whack has a bunch of decimal places, which looks suspicious. Sometimes the lower value is the first target result, sometimes it's the second.

By the way, the relevant schema looks like this:
[stats]
pattern = ^stats\.
retentions = 10s:1d,1min:30d,1h:2y

And the relevant aggregation looks like this:
[sum]
pattern = \.count$
xFilesFactor = 0
aggregationMethod = sum

Any suggestions or clues what I should look into to prevent the odd summarize results?

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
Jason Dixon
Solved:
Last query:
Last reply:
Revision history for this message
Best Jason Dixon (jason-dixongroup) said :
#1

I've also noticed problems with summarize() when the query falls on an archive boundary. I've found that switching to smartSummarize() works well for us.

Revision history for this message
Jase Wells (jwells-7) said :
#2

Thanks! That seems to do the trick.