I’m working on a project for visualizing data that doesn’t change at regular intervals (eg, bug state). Consider this simplified line protocol (actual data has more metadata as tags as well as additional fields):
bugs,status=<open|closed> bugid=N,software=<software> <timestamp>
Visualizations might include total open bugs per day, open bugs by software per day, etc. With this, if I send in data at least daily, the visualization looks good (bug status changes throughout the day are not particularly interesting so I figured I’d perhaps use a downsampling task or just look at the last item per day; this is not relevant to this topic).
The problem is, if I don’t send in data one day, I have graphs like this:
| -^- |--^-- --/ \ 0| \/ \ (these dips represent missing data)
AIUI, I can
fill() null values but not missing data. What I’d like is for the above graph to look like (where
f shows where missing data was filled in with whatever came before):
| -^-ff |--^--ff--/ 0|
TIL about the
interpolate.linear() function, but it doesn’t work on string data.
A straightforward way to solve this would be to ensure that I send in data at least daily. For reasons not relevant to this discussion, I’m trying to avoid that.
Thoughts I had (in order of preference):
- tell the visualization to fill in missing data (perhaps I missed something obvious?)
- use flux in some manner to fill in the data as part of the query, so the visualization looks correct
- use flux in a task in some manner to duplicate yesterday’s points into today (similar to downsampling in some ways)
- something else?
Since I’m new to flux, I’m not sure which approach is best (or how to do them! ).
Thanks in advance for any advice and tips!