diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-11-25 17:33:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-11-25 17:34:10 +0000 |
commit | 83ba6762cc43d9db581b979bb5e3445669e46cc2 (patch) | |
tree | 2e69833b43f791ed253a7a20318b767ebe56cdb8 /src/collectors/profile.plugin/plugin_profile.cc | |
parent | Releasing debian version 1.47.5-1. (diff) | |
download | netdata-83ba6762cc43d9db581b979bb5e3445669e46cc2.tar.xz netdata-83ba6762cc43d9db581b979bb5e3445669e46cc2.zip |
Merging upstream version 2.0.3+dfsg (Closes: #923993, #1042533, #1045145).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/collectors/profile.plugin/plugin_profile.cc')
-rw-r--r-- | src/collectors/profile.plugin/plugin_profile.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/collectors/profile.plugin/plugin_profile.cc b/src/collectors/profile.plugin/plugin_profile.cc index 390bca29e..14de55db1 100644 --- a/src/collectors/profile.plugin/plugin_profile.cc +++ b/src/collectors/profile.plugin/plugin_profile.cc @@ -117,7 +117,7 @@ public: worker_register_job_custom_metric(WORKER_JOB_METRIC_POINTS_BACKFILLED, "points backfilled", "points", WORKER_METRIC_ABSOLUTE); heartbeat_t HB; - heartbeat_init(&HB); + heartbeat_init(&HB, UpdateEvery * USEC_PER_SEC); worker_is_busy(WORKER_JOB_CREATE_CHARTS); create(); @@ -157,7 +157,7 @@ public: if (CollectionTV.tv_sec >= NowTV.tv_sec) { worker_is_idle(); - heartbeat_next(&HB, UpdateEvery * USEC_PER_SEC); + heartbeat_next(&HB); } } } @@ -194,9 +194,11 @@ static void profile_main_cleanup(void *pptr) { extern "C" void *profile_main(void *ptr) { CLEANUP_FUNCTION_REGISTER(profile_main_cleanup) cleanup_ptr = ptr; - int UpdateEvery = (int) config_get_number(CONFIG_SECTION_PROFILE, "update every", 1); - if (UpdateEvery < localhost->rrd_update_every) + int UpdateEvery = (int) config_get_duration_seconds(CONFIG_SECTION_PROFILE, "update every", 1); + if (UpdateEvery < localhost->rrd_update_every) { UpdateEvery = localhost->rrd_update_every; + config_set_duration_seconds(CONFIG_SECTION_PROFILE, "update every", UpdateEvery); + } // pick low-default values, in case this plugin is ever enabled accidentaly. size_t NumThreads = config_get_number(CONFIG_SECTION_PROFILE, "number of threads", 2); |