I use InfluxDB v2 alpha 8 to visualize some sensor data. The sensors update about once per minute. I have noticed that when I select a large time window (e.g. 2 weeks), a large amount of data is transmitted, which is slow and unnecessary.
Therefore I thought it would be useful to have the graphs automatically show the mean of the data, using a variable time window based on the selected duration.
The query works, but I don’t think this quite does what I want
Using the every: parameter along with autoInterval allows Chronograf to dynamically determine the size of the window based on the screen real-estate that is available for visualizing the results.
Whereas
The value of this variable is calculated by dividing the total time within the displayed time range by the dashboard refresh interval (defined by the Refresh dropdown).
What I was hoping for is a way to automatically average/sample the data based on the screen estate.
E.g. if the query is used to display a graph in a small widget 200px wide, no matter how large the time window selected is, I only want 200 datapoints transfered. Any more is not very useful, because we are limited to 200px anyway, so there is no point in first sending 10k data points to the browser, then esentially reducing them to 200 clientside during rendering.
With the query you provided, still 5mb of data is transfered for a single sensor widget with a 2wk timeframe, which is excessive and very slow when on a slow connection.
Anyway, I have created a task that aggregates by hour and can use this instead, if the selected timewindow is large, but was wondering if there is something built in.
On the other hand, the advantage of scheduling the aggregates is (I guess) that it will also lower the DB server load, as aggregation is then only done once, not on every graph display.