[rrd-users] Newbie Question Storing Absolute Values versus Average
Karl Fischer
rrd-users at ficos.de
Thu Jun 5 20:04:00 CEST 2008
Guy Fleegman wrote:
> If I want to make certain the value I sent is what is reflected in the
> RRD... There should only be one update *on* the step not *during*..
> Is that right?
yeah ...
or you always use an (initial) step of 1 and let the rra do it's job:
see what happens:
#!/bin/bash
rrdtool create test3.rrd --start now --step 1 \
DS:in:GAUGE:120:U:U \
RRA:LAST:0.5:1:5 \
RRA:LAST:0.5:5:5
echo created.
a=0
while [ $a -lt 6 ]; do
sleep 3
DATE=( $(date "+%Y-%m-%d %T %s") )
echo ${DATE[*]} $a
rrdtool updatev test3.rrd ${DATE[2]}:$a
a=$(($a+1))
sleep 2
done
rrdtool dump test3.rrd | grep row
created.
2008-06-05 20:00:23 1212688823 0
return_value = 0
[1212688821]RRA[LAST][1]DS[in] = 0.0000000000e+00
[1212688822]RRA[LAST][1]DS[in] = 0.0000000000e+00
[1212688823]RRA[LAST][1]DS[in] = 0.0000000000e+00
2008-06-05 20:00:28 1212688828 1
return_value = 0
[1212688824]RRA[LAST][1]DS[in] = 1.0000000000e+00
[1212688825]RRA[LAST][1]DS[in] = 1.0000000000e+00
[1212688826]RRA[LAST][1]DS[in] = 1.0000000000e+00
[1212688827]RRA[LAST][1]DS[in] = 1.0000000000e+00
[1212688828]RRA[LAST][1]DS[in] = 1.0000000000e+00
[1212688825]RRA[LAST][5]DS[in] = 1.0000000000e+00
2008-06-05 20:00:33 1212688833 2
return_value = 0
[1212688829]RRA[LAST][1]DS[in] = 2.0000000000e+00
[1212688830]RRA[LAST][1]DS[in] = 2.0000000000e+00
[1212688831]RRA[LAST][1]DS[in] = 2.0000000000e+00
[1212688832]RRA[LAST][1]DS[in] = 2.0000000000e+00
[1212688833]RRA[LAST][1]DS[in] = 2.0000000000e+00
[1212688830]RRA[LAST][5]DS[in] = 2.0000000000e+00
2008-06-05 20:00:38 1212688838 3
...
<pdp_per_row> 1 </pdp_per_row> <!-- 1 seconds -->
<!-- 2008-06-05 20:00:44 CEST / 1212688844 --> <row><v> 5.0000000000e+00 </v></row>
<!-- 2008-06-05 20:00:45 CEST / 1212688845 --> <row><v> 5.0000000000e+00 </v></row>
<!-- 2008-06-05 20:00:46 CEST / 1212688846 --> <row><v> 5.0000000000e+00 </v></row>
<!-- 2008-06-05 20:00:47 CEST / 1212688847 --> <row><v> 5.0000000000e+00 </v></row>
<!-- 2008-06-05 20:00:48 CEST / 1212688848 --> <row><v> 5.0000000000e+00 </v></row>
<pdp_per_row> 5 </pdp_per_row> <!-- 5 seconds -->
<!-- 2008-06-05 20:00:25 CEST / 1212688825 --> <row><v> 1.0000000000e+00 </v></row>
<!-- 2008-06-05 20:00:30 CEST / 1212688830 --> <row><v> 2.0000000000e+00 </v></row>
<!-- 2008-06-05 20:00:35 CEST / 1212688835 --> <row><v> 3.0000000000e+00 </v></row>
<!-- 2008-06-05 20:00:40 CEST / 1212688840 --> <row><v> 4.0000000000e+00 </v></row>
<!-- 2008-06-05 20:00:45 CEST / 1212688845 --> <row><v> 5.0000000000e+00 </v></row>
More information about the rrd-users
mailing list