summaryrefslogtreecommitdiffstats
path: root/libnetdata/worker_utilization
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2022-11-25 20:37:15 +0200
committerGitHub <noreply@github.com>2022-11-25 20:37:15 +0200
commit2e874e79163771856e4e756b176b729f7d8b0f0f (patch)
treeeeb1ea10af039001e3290090d5a2d365f99f63c7 /libnetdata/worker_utilization
parent870acd61123ece7c074242e1b02d47cb7c667e38 (diff)
replication fixes #6 (#14046)
use the faster monotonic clock in workers and replication; avoid unecessary statistics function on every request on replication - gather them all together once every second; check the chart flags on all mirrored hosts, not only the ones that have a sender; cleanup and unify replication logs; added child world time to REND; fix first BEGIN been transmitted when replication starts;
Diffstat (limited to 'libnetdata/worker_utilization')
-rw-r--r--libnetdata/worker_utilization/worker_utilization.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libnetdata/worker_utilization/worker_utilization.c b/libnetdata/worker_utilization/worker_utilization.c
index 700f88a736..14b8926e04 100644
--- a/libnetdata/worker_utilization/worker_utilization.c
+++ b/libnetdata/worker_utilization/worker_utilization.c
@@ -56,7 +56,7 @@ void worker_register(const char *workname) {
worker->tag = strdupz(netdata_thread_tag());
worker->workname = strdupz(workname);
- usec_t now = now_realtime_usec();
+ usec_t now = now_monotonic_usec();
worker->statistics_last_checkpoint = now;
worker->last_action_timestamp = now;
worker->last_action = WORKER_IDLE;
@@ -145,14 +145,14 @@ static inline void worker_is_idle_with_time(usec_t now) {
void worker_is_idle(void) {
if(unlikely(!worker || worker->last_action != WORKER_BUSY)) return;
- worker_is_idle_with_time(now_realtime_usec());
+ worker_is_idle_with_time(now_monotonic_usec());
}
void worker_is_busy(size_t job_id) {
if(unlikely(!worker || job_id >= WORKER_UTILIZATION_MAX_JOB_TYPES))
return;
- usec_t now = now_realtime_usec();
+ usec_t now = now_monotonic_usec();
if(worker->last_action == WORKER_BUSY)
worker_is_idle_with_time(now);
@@ -215,7 +215,7 @@ void workers_foreach(const char *workname, void (*callback)(
struct worker *p;
DOUBLE_LINKED_LIST_FOREACH_FORWARD(base, p, prev, next) {
- usec_t now = now_realtime_usec();
+ usec_t now = now_monotonic_usec();
// find per job type statistics
STRING *per_job_type_name[WORKER_UTILIZATION_MAX_JOB_TYPES];