# [rrd-users] How to graph slow changing counters

Thorsten Erdmann thorsten at trektech.de
Sun Mar 29 16:28:30 CEST 2020

```Hi,

I want to graph the data of my energy meter. But it is measuring only in
1kWh raster. So with normal power usage I have every 2..4 hours a step of
1kWh. The meter displays it's data as kWh, so it gives e.g 600 for the
absolute counter value of 600kWh.

I sample the absolute energy every 5 minutes. So I took this as step and
600s as heartbeat.

What I get is short peaks with a height which is displayed as 330u over a
period of 24h. With longer periods like a week the values get smaller and
smaller and there are weird stepping curves. So how can I measure/graph such
low resolution measures in a senseful way?

This is how I defined the data:

ret = rrdtool.create(rrdname + '.rrd', '--step', '300',
'--start', str(starttime),

'DS:Gauge:GAUGE:600:U:U',

'DS:Counter:COUNTER:600:U:U',

'RRA:AVERAGE:0.5:5m:24h',

'RRA:AVERAGE:0.5:2h:31d',

'RRA:AVERAGE:0.5:6h:31d',

'RRA:AVERAGE:0.5:1d:1y')

And this is how I graph them

ret = rrdtool.graph(rrdname + '24h.png', '--start', 'end-24h', '--end',
'now',

'--upper-limit', '650', '--lower-limit', '600', '--rigid',
'--right-axis', '0.00001:-0.006',

'DEF:gauge=./' + rrdname + '.rrd:Gauge:AVERAGE',

'DEF:counter=./' + rrdname + '.rrd:Counter:AVERAGE',

'CDEF:cnt1000=600,counter,10000,*,+',

'LINE1:gauge#00ff00:Gauge',

'LINE1:cnt1000#ff0000:Counter')

The gauge line looks good, but the counter line looks weird.

Thanks

Thorsten

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.oetiker.ch/pipermail/rrd-users/attachments/20200329/5bc16f68/attachment.html>
```