User Tools

Site Tools


geek:grafana

This is an old revision of the document!


Grafana

Kilobytes per second

From my load logger project I collect the number of bytes in/out of my network devices. If I want to graph that in grafana using my MySQL data source (as KB/s) then I have to use SQL to munge the numbers:

SELECT
      id,
      created_on,
      n4_r, 
      ((n4_r - @lastValue) / 1024 )/60 AS AvgKbPerSec,
      @lastValue := n4_r
   FROM
      data_logger,
      ( SELECT @lastValue := 0 ) SQLVars
   ORDER BY
created_on,id
geek/grafana.1587337534.txt.gz · Last modified: 2020/04/20 00:05 by admin