I'm wanting to graph the memory of certain processes in windows using rrdtool which I can then show in a simple webpage.
So I got this far. Not quite sure I understand how it works after following some tutorials I get blank output.
rrdtool create psrvr-mem.rrd --start 1023654125 --step 300 DS:mem:GAUGE:600:0:U RRA:AVERAGE:0.5:12:24 RRA:AVERAGE:0.5:288:31
Update script.
@ECHO OFF
:LOOP
FOR /F "tokens=*" %%g IN ('powershell "get-process psrvr | select -ExpandProperty PrivateMemorySize"') do (SET mem_usage=%%g)
rrdtool update psrvr-mem.rrd N:%mem_usage%
TIMEOUT /t 300
GOTO LOOP
And finally the graph
rrdtool graph memory.png --start -1800 -a PNG -t "Memory" --vertical-label "" -w 1260 -h 400 -r DEF:mem=psrvr-mem.rrd:mem:AVERAGE AREA:mem#FF0000
Unfortunately, the result is an empty graph. Not sure why. And not quite understanding if the start time is particularly critical or not.
-- edit -- Still not creating lines on the graph. However, well I found one problem is there were no labels on any axis. Because the font file was missing. Turns out the pre-compiled binaries downloaded from rrdtool website are 15 years out of date for windows. I found a newer binary but if I get this going then I'll probably try and compile it with the latest revision. For now, I'll settle with something that seems to be working better from 2013.
After more messing about this is my attempt at creating a 5 minute average. rrdtool create psrvr-mem.rrd --start 1592774026 --step 60 DS:mem:GAUGE:120:0:U RRA:AVERAGE:0.5:1:5
Then fill with some values using the update script above.
And then try to graph it again. rrdtool graph memory.png --start=now-300 -a PNG -t "Memory" --vertical-label "Bytes" -w 800 -h 300 -r DEF:mem=psrvr.rrd:mem:AVERAGE LINE:mem#FF0000
The output is a graph where the line isn't moving. It might be zero all the way.