diff options
author | Markos Fountoulakis <44345837+mfundul@users.noreply.github.com> | 2019-10-30 15:38:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-30 15:38:46 +0200 |
commit | 69e5e128f6c42e9bdfbe18e0725e4ea91f9f6950 (patch) | |
tree | 19703c72ca1aeea3e1eb9ef91a08a75f103320ec /libnetdata/storage_number | |
parent | c5487e20d8d591d2f9d6e141cc738f9cdb9a2e32 (diff) |
Fix counter reset detection (#7220)
* Removed support for 16-bit and 8-bit counter overflow
* Improve behaviour of counter overflow detection versus counter resets.
* Added support for signed 32-bit and 64-bit limits for counter overflows.
* Fixed signed incremental counter issues and added unit tests.
Diffstat (limited to 'libnetdata/storage_number')
-rw-r--r-- | libnetdata/storage_number/storage_number.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libnetdata/storage_number/storage_number.h b/libnetdata/storage_number/storage_number.h index da3ba23fa8..28b7f267c0 100644 --- a/libnetdata/storage_number/storage_number.h +++ b/libnetdata/storage_number/storage_number.h @@ -87,4 +87,8 @@ int print_calculated_number(char *str, calculated_number value); #define ACCURACY_LOSS_ACCEPTED_PERCENT 0.0001 #define accuracy_loss(t1, t2) (((t1) == (t2) || (t1) == 0.0 || (t2) == 0.0) ? 0.0 : (100.0 - (((t1) > (t2)) ? ((t2) * 100.0 / (t1) ) : ((t1) * 100.0 / (t2))))) +// Maximum acceptable rate of increase for counters. With a rate of 10% netdata can safely detect overflows with a +// period of at least every other 10 samples. +#define MAX_INCREMENTAL_PERCENT_RATE 10 + #endif /* NETDATA_STORAGE_NUMBER_H */ |