with
in yellow the values of a “test” time series
in blue the max and in purple the min of the same “test” but on average over the last 20 weeks
In this example, “Test” would have the value 23 at 8 a.m. and the average minimum of the values of “Test” at 8 a.m. over the last 20 weeks is 20 and the maximum is 34.
to retrieve the “test” values no problem I use this :
The new names “test_min” and “test_max” are not taken into account; both parameters appear as “test” on the graph.
My server load is increasing dramatically with this.
Isn’t it a very bad solution to calculate this history at each refresh? Shouldn’t I find a way to calculate and store the history so that it doesn’t have to be recalculated each time?
which way ?
How can I get the same kind of result with more lightness?
I’m using Telegraf to collect the data. Is there a way I can create the minimum and maximum historical values for each “test” point at the time of recording?
That was my mistake…I thought that you needed a package called “time” to do the truncate time function, but you figured out a way.
insert this line after each keep function:
|> rename(columns: {_field: "test_min"}) // change to test_max for the second query
Sure, you can calculate the min and max anytime you wish and store them in the database. But I feel that that shouldn’t be necessary unless you have a REALLY large number of data points every 20 weeks. About how many do you have?
You can also create a Flux task to downsample your data every n minutes (hours, days, etc.). More here: