[rrd-users] Update and graph doesn't show what I expect
Simon Hobson
linux at thehobsons.co.uk
Fri Feb 18 20:02:25 CET 2011
JoeSpam8 wrote:
> >>rrdtool updatev power.rrd N:17886
>>>
>>>It gives me this output:
>>>
>>>return_value = 0
> >>[1297974720]RRA[MIN][1]DS[tpower] = 5.9624031927e-01
> >>[1297974720]RRA[AVERAGE][1]DS[tpower] = 5.9624031927e-01
>>>[1297974720]RRA[MAX][1]DS[tpower] = 5.9624031927e-01
>>>[1297974720]RRA[LAST][1]DS[tpower] = 5.9624031927e-0
>>
>> http://www.vandenbogaerdt.nl/rrdtool/
>> and in particular :
>> http://www.vandenbogaerdt.nl/rrdtool/process.php
>>
>
>Nice example pages though I can't get it to fit. My values have never been
>anywhere near that number in the graph and even if the data is consolidated,
>it should represent the values inputted to the database - it doesn't.
Well I also have to point out that you've not provided enough
information to comment. You have ONE update listed there, and that is
not enough to form a value. Since RRD Tool only stores rates,
expressed as <somethings>/second then the values may well be somewhat
different to what you expect. But unless you have multiple updates at
times which allow a complete step period to have a value computed for
it, then it's impossible to say whether what you get is reasonable.
Also, you didn't specify what "N" was, but it's there in the output
you posted 1297974720 - these are (I assume) the values of the
internal accumulators used by RRD Tool. I do note that 59.6 (which is
5.96e-01) is 1/300 of the value put in. That would make sense if your
step size is 300 and your previous update was zero or unknown.
Further updates will accumulate until the next step boundary is
passed, at which point a normalised value will be computed.
So, if your step was 300, and you did updates of :
1297974600:0
1297974900:17886
then for the step period ending at 1297974900, the rate would be 59.6
which is consistent.
>But... I have changed the database now to GAUGE and I am putting in new
>data, representing the actual number I want.
RRD Tool is **NOT** designed for applications where you get out what
you put in. If you want to get out the same values you put in, then
another storage method is more appropriate. RRD Tool is designed to
easily take values over a period of time (and not necessarily at
regular intervals) and consolidate those for ease of output for such
things as graphs - it's origin being graphing of router traffic.
As to whether you are correct to change to gauge, that depends on
what your value represents. It sounds like you are using
instantaneous values of power (ie 17886 represents a load at that
point in time of a little under 18kW). If that is the case then gauge
is correct - and for best accuracy you need to update frequently. On
the other hand, if it represents a little under 18kJ (or kW seconds)
used to date (ie accumulated power used) then counter would be
correct. If you were using KwHr read from an electricity meter, then
you'd want to multiply the numbers by 3600 to get Kw seconds, and by
another 1000 to get W seconds. Ie if you went from 0 to 1 kW Hr, then
you'd want to feed in 3.6e6 (3,600,000) which when divided by 3600
would give you a result of 1000 watts averaged over the hour.
> It has lead me to a new
>question but I will create a new thread.
>
>Thanks for the links - they are good (but wow RRDTool is complicated).
Actually I'd suggest RRD Tool is actually quite simple - but the
concepts behind what it does are very different from what most people
are used to. Variations on your question come up "quite regularly" on
this list.
--
Simon Hobson
Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.
More information about the rrd-users
mailing list