[rrd-users] MAX doesn't work as expected: peaks are filtered

2004-08-15 Thread Cristian Ghezzi
I found the behaviour of rrdtool when using the MAX CF to be misleading 
to say the least.
It appears that all values inserted in the database within the last STEP 
period are always averaged when creating a PDP, even when I'm going to 
use the value in a MAX RRA, thus creating spurious values.
The manual seems to confirm this behaviour:
"If the interval between samples is less than ``heartbeat'', then an 
average rate is calculated and applied for that interval."

This means that if I insert more than one value within a step, I will 
not find the MAX of those values in the database, but an average value 
which will always be lower than expected.
Furthermore, even if I update the database with one value per STEP, I 
must ensure that updates are aligned to the STEP period, otherwise I 
will get an average value again and peaks will be cut..

Example:

I want to plot the maximum response time of a web server during the past 
20 minutes, plotting updated graphs every 10 seconds.

- I create a database to store the response time with PDPs every 10 seconds
- I keep the MAXimum value of the response time in a RRA

$ rrdtool create test.rrd --step 10 DS:source1:GAUGE:20:U:U 
RRA:MAX:0.5:1:120

- If I insert three values (100, 200, 300) STEP-aligned (60, 70, 80) and 
everything works fine

$ rrdtool update test.rrd 1092402360:100 1092402370:200 1092402380:300
$ rrdtool fetch test.rrd MAX --start 1092402360 --end 1092402420
 source1

1092402360: 1.00e+02
1092402370: 2.00e+02
1092402380: 3.00e+02
1092402390: nan
1092402400: nan
1092402410: nan
1092402420: nan

- If the update time occurs at half-STEP (85, 95), the two values (400, 
500) are averaged (450)

$ rrdtool update test.rrd 1092402385:400 1092402395:500
$ rrdtool fetch test.rrd MAX --start 1092402360 --end 1092402420
 source1

1092402360: 1.00e+02
1092402370: 2.00e+02
1092402380: 3.00e+02
1092402390: 4.50e+02
1092402400: nan
1092402410: nan
1092402420: nan

- In the above example, I get a value of 450 which is neither 400 nor 
500. It is a value that never got inserted in the database,
therefore is a wrong value which never occurred. Still I can accept this 
behaviour if I assume that the response time increased linearly with 
time from 400 to 500.

- The next update is again at half-STEP (05) with a value of 400

$ rrdtool update test.rrd 1092405105:400
$ rrdtool fetch test.rrd MAX --start 1092402360 --end 1092402420
 source1

1092402360: nan
1092402370: 2.00e+02
1092402380: 3.00e+02
1092402390: 4.50e+02
1092402400: 4.50e+02
1092402410: nan
1092402420: nan

- What happens is clearly wrong: the value of 500 inserted in the middle 
of the previous STEP, which is an absolute maximum for the whole period, 
has been smoothed down to 450.

Am I doing something wrong?
Is the only solution to always update the database with STEP-aligned 
values?
Is there another approach to the problem?
Is RRDTool unsuitable for the task?


Thank you

Cristian Ghezzi

--
Unsubscribe mailto:[EMAIL PROTECTED]
Helpmailto:[EMAIL PROTECTED]
Archive http://www.ee.ethz.ch/~slist/rrd-users
WebAdminhttp://www.ee.ethz.ch/~slist/lsg2.cgi


[rrd-users] Re: help with cdef

2004-08-15 Thread Alex van den Bogaerdt
On Sat, Aug 14, 2004 at 10:20:16AM -0700, winkey wrote:

> i cannot seem to figure this out, i get results i do not expect
> 
> rrdtool graph \
> /home/rush/public_html/weather/metar/dir.gif \
> --color=BACK#CC \
> --color=CANVAS#CC \
> --title="Daily Wind Direction" \
> --width=300 \
> 
> DEF:dir=/home/rush/public_html/weather/metar/weather.rrd:winddir:AVERAGE \
> 
> DEF:speed=/home/rush/public_html/weather/metar/weather.rrd:windspeed:AVERAGE \
> CDEF:calm=speed,0,EQ \
> CDEF:mydir=calm,UNKN,dir,IF \
> LINE2:mydir#00a000:"Degrees"
> 
> 
> basicly if speed is zero i want an unknown value for direction but i
> seem to be ending up with unknowns for speeds greater than zero and
> other anomolys

EQ gives a boolean as result.  "calm=speed,0,EQ" results in:

if speed==0
   then return true
   else return false

Next you are using that boolean in an if-then-else:

if calm
   then return UNKN
   else return direction

The end result will be:

if (speed==0)
   then return unknown
   else return direction.

This matches what you expect.  If the result is not what you expect,
most likely the input is not what you think it is.

HTH
Alex

--
Unsubscribe mailto:[EMAIL PROTECTED]
Helpmailto:[EMAIL PROTECTED]
Archive http://www.ee.ethz.ch/~slist/rrd-users
WebAdminhttp://www.ee.ethz.ch/~slist/lsg2.cgi


[rrd-users] How to have long title in RRD graphs ?

2004-08-15 Thread Didier
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,

I'm studing the ability to have long titles on RRD graphs (lets say =
110-120 characters)
Is there a way to reduce the size of the font used in the title or =
add a new line in the title ?
When too long it is truncated currently.

   As you can see in the joined picture we cannot see the whole title

rrdtool.exe graph titi.png --imgformat=3DPNG --start=3D-86400 =
--end=3D-300 --base=3D1000 --height=3D120 --width=3D500 =
--alt-autoscale-max --lower-limit=3D0 =
DEF:a=3Dtest1_ds1_12.rrd:ds1:AVERAGE LINE3:a#157419:"Time response %lf" =
--title=3D"[M010] EC.ECL.VAN.SUB-ECL-VAN-0 --> AEC.DAL.PARTNER-AEC-DAL-1 =
 1234567891012345678901234567801234567890"
595x192



[M010] EC.ECL.VAN.SUB-ECL-VAN-0 --> AEC.DAL.PARTNER-AEC-DAL-1  =
1234567891012345678901234567801234567890"
1234567890123456789012345678901234567890123456789012345678901234567890123=
4567890123456789012345678901234567890
1   234  =
  5   678=
910 11

Thanks a lot for any help

Didier


-- Attached file removed by Ecartis and put at URL below --
-- Type: image/png
-- Size: 4k (4365 bytes)
-- URL : http://www.ee.ethz.ch/~slist/p/long_title.png


--
Unsubscribe mailto:[EMAIL PROTECTED]
Helpmailto:[EMAIL PROTECTED]
Archive http://www.ee.ethz.ch/~slist/rrd-users
WebAdminhttp://www.ee.ethz.ch/~slist/lsg2.cgi