Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculating percentage with Grafana/Graphite

I'm struggling with calculating the percentage of a list of servers.

What I have is:

icinga2.$server.services.Memory_Load.memory-windows.perfdata.memory.value

and

icinga2.$server.services.Memory_Load.memory-windows.perfdata.memory.max

I can't figure out how to calculate a percentage from those values.

Anyone can help me out?

I tried to fool around with reduceSeries, mapSeries and asPercent but always get a query error out of it.

Example I tried:

reduceSeries(mapSeries(icinga2.$server.services.Memory_Load.memory-windows.perfdata.memory.*,1),"asPercent",3,"value","max")

Thanks in advance

like image 281
mike.b93 Avatar asked Dec 03 '25 23:12

mike.b93


1 Answers

you will be needing four queries to achieve it. You can also do it in one.

#A icinga2.$server.services.Memory_Load.memory-windows.perfdata.memory.value

#B icinga2.$server.services.Memory_Load.memory-windows.perfdata.memory.max

#C divideSeries(#A,#B)

#D scale(#C,100)

in the end turnoff all the queries visibility except #D

make sure to select unit as percent in Axes tab in left-y axis.

like image 185
Bilal Ali Jafri Avatar answered Dec 06 '25 23:12

Bilal Ali Jafri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!