This is an old revision of the document!
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