Re: Using a windowed counter
"Alex van den Bogaerdt" <[email protected]> Wed, 14 Jun 2017 01:07:31 +0200
| Newsgroups | gmane.comp.db.rrdtool.user |
|---|---|
| Message-ID | <dc1bb34748603e81961124763b2d52b7.squirrel@webmail.argewebhosting.nl> |
> A far simpler solution is; it's just a counter that resets every hour.
No it's not.
>> > 011111244445678888889998767777765555553444335888889899987677
>> > 010000120001121000121000012000110000010100012300011010001210
------------
------------
Look approximately halfway: 98767
Then look below: 00012
The "counter" goes from 7 to 6, as a result of rainfall 1 being added and
2 being removed from the window.
If you treat this as a counter being reset every hour, you would get
negative rainfall, or counter overflow with the resulting huge flood, or
rates becoming unknown because of sanity checks.