[rrd-users] Undesired fractions

Jan Engelhardt jengelh at computergmbh.de
Mon Dec 17 21:35:38 CET 2007


Hi,


we observed that in the following testcase, the RRA accumulates numbers 
with a fractional part, which is undesired for our purpose.

	#!/bin/bash

	rrdtool create foo.rrd --step 1 DS:foo:GAUGE:120:U:U RRA:LAST:0:1:60;
	rrdtool update foo.rrd N:0;
	sleep 1;
	rrdtool update foo.rrd N:1;
	# Show problem
	rrdtool dump foo.rrd | grep '\.[1-9]';

How could this be solved so that the RRA only ever contains integers and 
does not average over two values?

What's more, the value that gets record in the RRA seems to depend on 
the moon phase, or at least the subsecond granularity of bash execution 
time and sleep wait time:

	$ sh ts
	<value> 3.2619000000e-02 </value>
	<primary_value> 9.7739700000e-01 </primary_value>
	<!-- 2007-12-17 21:34:05 CET / 1197923645 --> 
	<row><v> 9.7739700000e-01 </v></row>

	$ sh ts
	<value> 1.6257900000e-01 </value>
	<primary_value> 8.4968000000e-01 </primary_value>
	<!-- 2007-12-17 21:34:08 CET / 1197923648 --> 
	<row><v> 8.4968000000e-01 </v></row>


thanks,
Jan



More information about the rrd-users mailing list