Stat panel for Use rate with discret data


I have this type of data, where I know each sec the feedback of my motor:
1 = running
0 = not running

|Timestamp|Motor feedback (1 or 0)|
|2023-03-12 15:00:01 |0|
|2023-03-12 15:00:02 |1|
|2023-03-12 15:00:03 |1|
|2023-03-12 15:00:04 |1|


I would like to get the usage rate of the motor, in %, using a stat panel.

May I get help from the community to get this panel straight?


What is your datasource? Mysql influxdb or postgres

1 Like


is it possible to trend this % ?

What are the parameters and requirements: per hour, per minute etc

If you do it purely in mysql then it is not really a grafana question
A mysql forum might be the more appropriate spot
Trend Percentage = ((Current Period Value - Base Period Value) / Base Period Value) * 100 .

you mean that i have to create new data in the DB ? it can not be “temporary” created in grafana?

I would like to have a trend of this use rate in % with a 5 min sample time.

Other question, if I am doing exactly the same data transformation on a gauge, I do not get the same result???

I dont see that being suggested at all. Where do you read that ?

1 Like

1st, thanks a lot for your support.

what I mean is

  • I have only the raw data in my SQL DB.

  • I have now a STAT panel showing a % of use rate (% of when the input is = 1 on a time period selected by the timepicker)

  • I would like now to be able to show this % on a timeseries graph or on the same STAT Panel

By the way, I tried to display this same use rate information on a Gauge Panel, with the same data transformation, but the result is different. any idea why?

i found why the result was different, you can ignore that part

1 Like

Is it possible to trend this % now?