I am using prometheus-cpp library , Prometheus v2.34, Grafana v8.4.5 and operating system Windows 10.
And I want to calculate the intensity of my application.
This application processes files.
I count the processing time of each file and send it to Prometheus as a counter.Increment(Processed_time).
Then in Grafana I use the delta() function to calculate the intensity.
The idea is this: if files were processed for 40 seconds in 1 minute, then the intensity is 40/60.
I am using the delta() function:
delta(application_time_total_sec{}[1m]) / (60*1)
But there are two problems:
-
sometimes incorrect values are obtained after the delta() function: they are greater than 1. It was as if my application worked 75 seconds in 1 minute))
Incorrect results of delta() function -
If I want to increase the interval from 1 minute to 5 minutes, then I get crazy data.
delta(application_time_total_sec{}[5m]) / (60*5)
Am I using the delta() function incorrectly?