Re: [rrd-users] Measuring rain from weatherstation

2014-12-08 Thread Simon Hobson
Alex van den Bogaerdt a...@vandenbogaerdt.nl wrote:

 As before: don't write to RRDtool unless the value tipped over to the next 
 number.  There won't be spikes. The amount of rain will be divided by the 
 amount of seconds since the last update.

So use derive data type, write 0.5 (or any larger value that's accumulated) 
followed by 0 whenever the counter tips over ?
Guess we need to write 0 periodically to avoid getting long periods of unknown.

So we end up with :

forever
  read value
  if value  min
reset counter
reset timer
write T:value to rrd
writeT+1:0 to rrd
  else
if timer  some_period
write T:0 to rrd
reset timer
  sleep for a bit
go back and do it all again

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


Re: [rrd-users] Measuring rain from weatherstation

2014-12-08 Thread Alex van den Bogaerdt

So we end up with :

forever
 read value
 if value  min
   reset counter
   reset timer
   write T:value to rrd
   writeT+1:0 to rrd
 else
   if timer  some_period
   write T:0 to rrd
   reset timer
 sleep for a bit
go back and do it all again


Not quite.  I think you are mixing two different solutions.

Option 1: don't reset the counter every time it is read. The counter will 
reset itself just after midnight.  In this case use DERIVE and optionally do 
write that zero. Writing the zero is optional, it will help a bit in 
preventing an unknown at the beginning of each day.


Option 2: (if possible) reset the counter every time it changed. This means 
using ABSOLUTE as counter type. Write the appropriate amount to RRD. Do not 
write an extra zero to the rrd, this is already taken care of by using 
ABSOLUTE.


But yes, something does need to be done before the hearbeat timer expires, 
in both cases.


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