Re: [rrd-users] problem understanding update

This is a discussion on Re: [rrd-users] problem understanding update within the RRD Users forums, part of the Networking and Network Related category; On Thu, Nov 29, 2007 at 05:20:53PM +0100, marie wrote: > Hi all, > > I have trouble ...


Go Back   Usenet Forums > Networking and Network Related > RRD Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-29-2007
Alex van den Bogaerdt
 
Posts: n/a
Default Re: [rrd-users] problem understanding update

On Thu, Nov 29, 2007 at 05:20:53PM +0100, marie wrote:
> Hi all,
>
> I have trouble understanding the update function behaviour, mainly with
> the 'N' feature.
>
> Assume you have created the following rrd database:
>
> --
> rrdtool create test_mechanism.rrd --start `date +%s` --step 1 \
> DS:number:GAUGE:2:U:U RRA:LAST:0.5:1:20 ;
> --
>
> I try to update this small rrd by adding values (from 10 to 90 ) every
> second during 10 seconds with the following little bash script (which is
> not a very clean one!):
>
> --
> #!/bin/sh
>
> i=1
> while [ $i -lt 11 ]
> do
> current=`date +%s`
> value=`expr $i \* 10`
> # echo $value at $current
> rrdtool update test_mechanism.rrd N:$value
> i=`expr $i \+ 1`
> perl -e 'sleep 1 - time % 1'
> done


This is where you go wrong. You assume "N" equals 1196351129
but in reality it is more like 1196351129.312388

You sleep for less than one second, then assume "current=`date +%s`" is
happening at exactly a whole second, and you also assume computing
the value to update takes no time, and executing rrdtool does take no
time.

> Why is there such a difference in the values inserted by the two update
> ways ? (2.0000000000e+01 vs 6.8761200000e+00, for example)
> What am I misunderstanding ?


Look at my site, the part talking about normalizing

HTH
--
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/

_______________________________________________
rrd-users mailing list
rrd-users@lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:05 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0