Re: [rrd-users] RRA of unaltered data

2015-11-25 Thread Simon Hobson
Thomas Nilsson  wrote:

> 1. Is there a way to get the values I add to show up unaltered in the RRA?
>Tried with LAST, AVERAGE, MIN and MAX in the RRA declaration.
>   
> 2. How are the values in my RRA calculated?

These together must be one of the most frequently asked questions, to which 
there is a simple answer :
http://rrdtool.vandenbogaerdt.nl

In particular, "Rates, normalizing and consolidating" 
http://rrdtool.vandenbogaerdt.nl/process.php

The latter will answer question 2. Once you understand that, then you'll 
understand the answer to question 1 which is: ensure that the normalisation 
process is a "null operation". That means you must supply data on *exactly* 
step boundaries, for every step, only once per step, and missing no steps out.

So in your example, you must ensure that the timestamp of every update is on 
*exactly* a multiple of 5 seconds since unix epoch - not "now", not "a 5 second 
sleep plus the execution time of a few statements after the previous one", but 
on exactly a multiple of 5 seconds.
Thus (in bash) you can do :
s=5
t=date +%s
t=$( ( $t / $s ) * $s )
rrdtool update ... $t:$v

This will ensure that the values stored will be exactly what you put in - but 
only until there is some consolidation.

But in general, if you want to store exact values, and especially if they are 
produced at irregular times, then RRD is probably not the right tool.

___
rrd-users mailing list
rrd-users@lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users


[rrd-users] RRA of unaltered data

2015-11-25 Thread Thomas Nilsson
My shell script:

./rrdtool create test2.rrd \
--start now --step=5 \
DS:ok:GAUGE:10:0:100 \
RRA:LAST:0:1:10

for i in 2 20 4 40 6 60 8 80 10 100
do
  sleep 5
  ./rrdtool update test2.rrd -t ok N:$i
  echo "Updated DS \"ok\" with value $i"
done

./rrdtool dump test2.rrd


Wen I run my script it output this:

Updated DS "ok" with value 2
Updated DS "ok" with value 20
Updated DS "ok" with value 4
Updated DS "ok" with value 40
Updated DS "ok" with value 6
Updated DS "ok" with value 60
Updated DS "ok" with value 8
Updated DS "ok" with value 80
Updated DS "ok" with value 10
Updated DS "ok" with value 100

http://oss.oetiker.ch/rrdtool/rrdtool.dtd";>


   0003
5 
1448379137 


 ok 
 GAUGE 
10
0.00e+00
1.00e+02


100
2.976900e+02
 0 




LAST
1 


0.00e+00



4.6702324000e+01
0.00e+00
NaN
0



 
2.00e+00
 
9.6584168000e+00
 
1.3225379200e+01
 
1.9166821600e+01
 
2.5747227200e+01
 
2.8526251200e+01
 
3.8413156800e+01
 
3.7715062400e+01
 
5.1284544000e+01
 
4.6702324000e+01




RRDtool 1.5.5  Copyright by Tobias Oetiker 
   Compiled Nov 24 2015 16:14:27

Questions
1. Is there a way to get the values I add to show up unaltered in the RRA?
   Tried with LAST, AVERAGE, MIN and MAX in the RRA declaration.

2. How are the values in my RRA calculated?

___
rrd-users mailing list
rrd-users@lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users