summaryrefslogtreecommitdiffstats
path: root/daemon/event_loop.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-06 16:11:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-06 16:11:30 +0000
commitaa2fe8ccbfcb117efa207d10229eeeac5d0f97c7 (patch)
tree941cbdd387b41c1a81587c20a6df9f0e5e0ff7ab /daemon/event_loop.c
parentAdding upstream version 1.37.1. (diff)
downloadnetdata-aa2fe8ccbfcb117efa207d10229eeeac5d0f97c7.tar.xz
netdata-aa2fe8ccbfcb117efa207d10229eeeac5d0f97c7.zip
Adding upstream version 1.38.0.upstream/1.38.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'daemon/event_loop.c')
-rw-r--r--daemon/event_loop.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/daemon/event_loop.c b/daemon/event_loop.c
new file mode 100644
index 000000000..6f09cd654
--- /dev/null
+++ b/daemon/event_loop.c
@@ -0,0 +1,59 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include <daemon/main.h>
+#include "event_loop.h"
+
+// Register workers
+void register_libuv_worker_jobs() {
+ static __thread bool registered = false;
+
+ if(likely(registered))
+ return;
+
+ registered = true;
+
+ worker_register("LIBUV");
+
+ // generic
+ worker_register_job_name(UV_EVENT_WORKER_INIT, "worker init");
+
+ // query related
+ worker_register_job_name(UV_EVENT_DBENGINE_QUERY, "query");
+ worker_register_job_name(UV_EVENT_DBENGINE_EXTENT_CACHE_LOOKUP, "extent cache");
+ worker_register_job_name(UV_EVENT_DBENGINE_EXTENT_MMAP, "extent mmap");
+ worker_register_job_name(UV_EVENT_DBENGINE_EXTENT_DECOMPRESSION, "extent decompression");
+ worker_register_job_name(UV_EVENT_DBENGINE_EXTENT_PAGE_LOOKUP, "page lookup");
+ worker_register_job_name(UV_EVENT_DBENGINE_EXTENT_PAGE_POPULATION, "page populate");
+ worker_register_job_name(UV_EVENT_DBENGINE_EXTENT_PAGE_ALLOCATION, "page allocate");
+
+ // flushing related
+ worker_register_job_name(UV_EVENT_DBENGINE_FLUSH_MAIN_CACHE, "flush main");
+ worker_register_job_name(UV_EVENT_DBENGINE_EXTENT_WRITE, "extent write");
+ worker_register_job_name(UV_EVENT_DBENGINE_FLUSHED_TO_OPEN, "flushed to open");
+
+ // datafile full
+ worker_register_job_name(UV_EVENT_DBENGINE_JOURNAL_INDEX_WAIT, "jv2 index wait");
+ worker_register_job_name(UV_EVENT_DBENGINE_JOURNAL_INDEX, "jv2 indexing");
+
+ // db rotation related
+ worker_register_job_name(UV_EVENT_DBENGINE_DATAFILE_DELETE_WAIT, "datafile delete wait");
+ worker_register_job_name(UV_EVENT_DBENGINE_DATAFILE_DELETE, "datafile deletion");
+ worker_register_job_name(UV_EVENT_DBENGINE_FIND_ROTATED_METRICS, "find rotated metrics");
+ worker_register_job_name(UV_EVENT_DBENGINE_FIND_REMAINING_RETENTION, "find remaining retention");
+ worker_register_job_name(UV_EVENT_DBENGINE_POPULATE_MRG, "update retention");
+
+ // other dbengine events
+ worker_register_job_name(UV_EVENT_DBENGINE_EVICT_MAIN_CACHE, "evict main");
+ worker_register_job_name(UV_EVENT_DBENGINE_BUFFERS_CLEANUP, "dbengine buffers cleanup");
+ worker_register_job_name(UV_EVENT_DBENGINE_QUIESCE, "dbengine quiesce");
+ worker_register_job_name(UV_EVENT_DBENGINE_SHUTDOWN, "dbengine shutdown");
+
+ // metadata
+ worker_register_job_name(UV_EVENT_METADATA_STORE, "metadata store host");
+ worker_register_job_name(UV_EVENT_METADATA_CLEANUP, "metadata cleanup");
+
+ // netdatacli
+ worker_register_job_name(UV_EVENT_SCHEDULE_CMD, "schedule command");
+
+ uv_thread_set_name_np(pthread_self(), "LIBUV_WORKER");
+}