[rrd-users] Re: Compromised value after NaN
Markus Wiget
markus.wiget at terreactive.ch
Fri Dec 1 13:11:38 MET 2006
Thanks for spending time on my problem. According to your answer I tried
to simplify my request.
Alex van den Bogaerdt wrote:
> On Wed, Nov 29, 2006 at 12:35:01PM +0100, Markus Wiget wrote:
> step 300, heartbeat 600. This means that if the updates would be
> exactly five minutes apart, with the exception of that single one,
> you should see no gap, at all.
For simplifying the discussion I also changed the relation between step
and heartbeat in the example (below).
> Why don't you create a script that shows the problem? I mean a
> complete script, creating a (small!) database, doing (a few!) updates
> and showing the resulting data with rrdtool fetch (!)
Ok. Here is a Bash script which shows the problem. I tried with RRDtool
1.2.15.
echo '* Create rrdnan.rrd'
rrdtool create rrdnan.rrd --step=5 \
DS:testli:GAUGE:7:0:100 \
RRA:AVERAGE:0.5:1:16
echo '* Feed data'
declare -i i
declare s_date
for i in $(seq 1 10); do
sleep 5
s_date="N"
if [ ${i} -ne 6 ]; then
rrdtool update rrdnan.rrd --template=testli ${s_date}:100
echo "(${i} / $(date '+%H:%M:%S')) Updated ${s_date}:100"
else
echo "(${i} / $(date '+%H:%M:%S')) NOP"
fi
done
echo '* Fetch data'
rrdtool fetch rrdnan.rrd AVERAGE --start=-60
echo '* Finished'
My output is:
* Create rrdnan.rrd
* Feed data
(1 / 10:55:20) Updated N:100
(2 / 10:55:25) Updated N:100
(3 / 10:55:30) Updated N:100
(4 / 10:55:35) Updated N:100
(5 / 10:55:40) Updated N:100
(6 / 10:55:45) NOP
(7 / 10:55:50) Updated N:100
(8 / 10:55:55) Updated N:100
(9 / 10:56:00) Updated N:100
(10 / 10:56:05) Updated N:100
* Fetch data
testli
1164966910: nan
1164966915: nan
1164966920: nan
1164966925: 9.7952880000e+01
1164966930: 1.0000000000e+02
1164966935: 1.0000000000e+02
1164966940: 1.0000000000e+02
1164966945: nan
1164966950: nan
1164966955: 9.6657600000e+01
1164966960: 1.0000000000e+02
1164966965: 1.0000000000e+02
1164966970: nan
* Finished
> Use timestamps, not "N".
What's wrong when using "N"? I just read in the man page that it is
legal. Anyway, if I use explicit update time by replacing
s_date="N"
with
s_date="$(date '+%s')"
then I get this output:
[...]
* Fetch data
testli
1164967090: nan
1164967095: nan
1164967100: nan
1164967105: 1.0000000000e+02
1164967110: 1.0000000000e+02
1164967115: 1.0000000000e+02
1164967120: 1.0000000000e+02
1164967125: nan
1164967130: nan
1164967135: 1.0000000000e+02
1164967140: 1.0000000000e+02
1164967145: 1.0000000000e+02
1164967150: nan
* Finished
So it seems that we have two discussion issues:
#1 Why is the first value after the gap not 100 when updating with
implicit timestamp "N" (first output)?
>> But what I do not understand: the first
>> value after the NaN's is 9.99...+01, but I would expect 1.00...+02.
>
> It looks as if your NaN is somehow being mangled into zero. If this
> is indeed the case, I can see why your data would be corrupted.
#2 Why are there two NaN's?
>> So around 2:30 when the cron job is ommitted, I have two NaN's in the
>> RRD file; this I understand.
>
> I don't. Please explain why this would be.
I thought it is because RRD always requires two values to build a row:
the current and the previous value. This would mean for the first NaN,
the current is missing and for the second NaN the previous is missing.
But probably I'm totally wrong.
Again, I would be grateful for your support.
Thanks,
Markus Wiget
--
---------------------------------------------------------------
addr://Kasinostrasse 30, CH-5001 Aarau fon://++41 62 823 9355
http://www.terreactive.com fax://++41 62 823 9356
---------------------------------------------------------------
10 Jahre Kompetenz in IT-Sicherheit. 1996 - 2006
Wir sichern Ihren Erfolg. terreActive AG
---------------------------------------------------------------
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://lists.ee.ethz.ch/rrd-users
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
More information about the rrd-users
mailing list