diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2022-12-09 18:56:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-09 18:56:28 +0200 |
commit | 32d63fe9a6a18c9e757499f0e23a1169b516f9bf (patch) | |
tree | c59450adf9c48416435d26b44f28a61b88d9f093 | |
parent | c0d1d167c4108398400ea31a6bbf58e18d717132 (diff) |
heartbeat: don't log every discrepancy (#14122)
-rw-r--r-- | libnetdata/clocks/clocks.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libnetdata/clocks/clocks.c b/libnetdata/clocks/clocks.c index cabc0000e6..3c036facb8 100644 --- a/libnetdata/clocks/clocks.c +++ b/libnetdata/clocks/clocks.c @@ -296,7 +296,9 @@ usec_t heartbeat_next(heartbeat_t *hb, usec_t tick) { if(unlikely(hb->randomness > tick / 2)) { // TODO: The heartbeat tick should be specified at the heartbeat_init() function usec_t tmp = (now_realtime_usec() * clock_realtime_resolution) % (tick / 2); - info("heartbeat randomness of %llu is too big for a tick of %llu - setting it to %llu", hb->randomness, tick, tmp); + + error_limit_static_global_var(erl, 10, 0); + error_limit(&erl, "heartbeat randomness of %llu is too big for a tick of %llu - setting it to %llu", hb->randomness, tick, tmp); hb->randomness = tmp; } @@ -322,11 +324,13 @@ usec_t heartbeat_next(heartbeat_t *hb, usec_t tick) { if(unlikely(now < next)) { errno = 0; - error("heartbeat clock: woke up %llu microseconds earlier than expected (can be due to the CLOCK_REALTIME set to the past).", next - now); + error_limit_static_global_var(erl, 10, 0); + error_limit(&erl, "heartbeat clock: woke up %llu microseconds earlier than expected (can be due to the CLOCK_REALTIME set to the past).", next - now); } else if(unlikely(now - next > tick / 2)) { errno = 0; - error("heartbeat clock: woke up %llu microseconds later than expected (can be due to system load or the CLOCK_REALTIME set to the future).", now - next); + error_limit_static_global_var(erl, 10, 0); + error_limit(&erl, "heartbeat clock: woke up %llu microseconds later than expected (can be due to system load or the CLOCK_REALTIME set to the future).", now - next); } if(unlikely(!hb->realtime)) { |