Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support fill(null) #713

Closed
blalor opened this issue Jul 3, 2014 · 4 comments
Closed

support fill(null) #713

blalor opened this issue Jul 3, 2014 · 4 comments

Comments

@blalor
Copy link

blalor commented Jul 3, 2014

It would be useful if fill could also support taking null as a value, so that a client would know that data is missing.

@pauldix
Copy link
Member

pauldix commented Jul 3, 2014

I don't think there's a way to represent this in the JSON result. The null is really just the absence of a timestamped value. It's up to you charting library to represent that instead of just drawing a line between two other points. The best thing to do is to use bars or stacked bars and you'll see what you're expecting. There are other reasons stacked bars are superior: http://www.leancrew.com/all-this/2011/11/i-hate-stacked-area-charts/

I don't think there's anything actionable for us so I'm closing this out, but let me know if you have a use case I'm not thinking of.

@pauldix pauldix closed this as completed Jul 3, 2014
@blalor
Copy link
Author

blalor commented Jul 3, 2014

You could just send null. :-)

Given a query like select mean(value) from "canaryio.state.ok.events.rate" group by time(10s) order asc, I'll get the following back:

[{u'columns': [u'time', u'mean'],
  u'name': u'canaryio.state.ok.events.rate',
  u'points': [[1404378370, 11.9],
              [1404378380, 11.7],
              [1404378420, 5.6],
              [1404378430, 12.4],
              [1404378440, 12.9]]}]

The points at 1404378390, 1404378400 and 1404378410 are missing. If I add fill(0) I'll get:

[{u'columns': [u'time', u'mean'],
  u'name': u'canaryio.state.ok.events.rate',
  u'points': [[1404378370, 11.9],
              [1404378380, 11.7],
              [1404378390, 0],
              [1404378400, 0],
              [1404378410, 0],
              [1404378420, 5.6],
              [1404378430, 12.4],
              [1404378440, 12.9]]}]

What I want is to use fill(null) to get:

[{u'columns': [u'time', u'mean'],
  u'name': u'canaryio.state.ok.events.rate',
  u'points': [[1404378370, 11.9],
              [1404378380, 11.7],
              [1404378390, null],
              [1404378400, null],
              [1404378410, null],
              [1404378420, 5.6],
              [1404378430, 12.4],
              [1404378440, 12.9]]}]

This is what Graphite does for missing buckets, and it makes it so that the client doesn't have to do missing-value detection on its own. You're already supporting fill(0), so it seems like a logical extension to also support null.

@pauldix
Copy link
Member

pauldix commented Jul 3, 2014

I guess you're right :)

@pauldix pauldix reopened this Jul 3, 2014
@Dieterbe
Copy link
Contributor

Dieterbe commented Jul 4, 2014

+1 this will also be nice for the graphite-influxdb backend. Presumably influx can fill gaps faster than a retroactive (python) loop. + no need to reimplement the same thing in multiple clients. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants