Hi, I encountered some problems during the process of using InfluxDB. Could you please help me solve it?
-
InfluxDB Version:
1.8.5 -
InfluxQL:
Firstly, I searched a batch of data usingnon_negative_derivative
:
select non_negative_derivative(mean(value), 1s) as value from cpu where time>=1742784780s and time<=1742784900s and host='ServerG' group by "host","region",time(30s)
The returned data is as follows:
name: cpu
tags: host=ServerG, region=regionF
time value
---- -----
2025-03-24T02:53:00Z 99.92713464696222
2025-03-24T02:53:30Z 52.82068965517244
2025-03-24T02:54:00Z 61.2817471264368
2025-03-24T02:54:30Z 67.2928888888889
Then, I use sum()
to sum up the above results
select sum(value) from (select non_negative_derivative(mean(value)) as value from cpu where time>=1742784780s and time<=1742784900s and host='ServerG' group by "host","region",time(30s)) where time>=1742784780s and time<=1742784900s group by "region",time(30s)
The returned data is as follows:
name: cpu
tags: region=regionF
time sum
---- ---
2025-03-24T02:53:00Z
2025-03-24T02:53:30Z 52.82068965517244
2025-03-24T02:54:00Z 61.2817471264368
2025-03-24T02:54:30Z 67.2928888888889
2025-03-24T02:55:00Z
- Question
I want to know why the first and last time windows in the second query result have no values?