summaryrefslogtreecommitdiffstats
path: root/daemon/global_statistics.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-17 09:30:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-17 09:30:23 +0000
commit517a443636daa1e8085cb4e5325524a54e8a8fd7 (patch)
tree5352109cc7cd5122274ab0cfc1f887b685f04edf /daemon/global_statistics.c
parentReleasing debian version 1.42.4-1. (diff)
downloadnetdata-517a443636daa1e8085cb4e5325524a54e8a8fd7.tar.xz
netdata-517a443636daa1e8085cb4e5325524a54e8a8fd7.zip
Merging upstream version 1.43.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'daemon/global_statistics.c')
-rw-r--r--daemon/global_statistics.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/daemon/global_statistics.c b/daemon/global_statistics.c
index ce8d41402..ab910e189 100644
--- a/daemon/global_statistics.c
+++ b/daemon/global_statistics.c
@@ -2681,9 +2681,12 @@ static void dbengine2_statistics_charts(void) {
static void update_strings_charts() {
static RRDSET *st_ops = NULL, *st_entries = NULL, *st_mem = NULL;
- static RRDDIM *rd_ops_inserts = NULL, *rd_ops_deletes = NULL, *rd_ops_searches = NULL, *rd_ops_duplications = NULL, *rd_ops_releases = NULL;
- static RRDDIM *rd_entries_entries = NULL, *rd_entries_refs = NULL;
+ static RRDDIM *rd_ops_inserts = NULL, *rd_ops_deletes = NULL;
+ static RRDDIM *rd_entries_entries = NULL;
static RRDDIM *rd_mem = NULL;
+#ifdef NETDATA_INTERNAL_CHECKS
+ static RRDDIM *rd_entries_refs = NULL, *rd_ops_releases = NULL, *rd_ops_duplications = NULL, *rd_ops_searches = NULL;
+#endif
size_t inserts, deletes, searches, entries, references, memory, duplications, releases;
@@ -2706,16 +2709,20 @@ static void update_strings_charts() {
rd_ops_inserts = rrddim_add(st_ops, "inserts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
rd_ops_deletes = rrddim_add(st_ops, "deletes", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+#ifdef NETDATA_INTERNAL_CHECKS
rd_ops_searches = rrddim_add(st_ops, "searches", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
rd_ops_duplications = rrddim_add(st_ops, "duplications", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
rd_ops_releases = rrddim_add(st_ops, "releases", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+#endif
}
rrddim_set_by_pointer(st_ops, rd_ops_inserts, (collected_number)inserts);
rrddim_set_by_pointer(st_ops, rd_ops_deletes, (collected_number)deletes);
+#ifdef NETDATA_INTERNAL_CHECKS
rrddim_set_by_pointer(st_ops, rd_ops_searches, (collected_number)searches);
rrddim_set_by_pointer(st_ops, rd_ops_duplications, (collected_number)duplications);
rrddim_set_by_pointer(st_ops, rd_ops_releases, (collected_number)releases);
+#endif
rrdset_done(st_ops);
if (unlikely(!st_entries)) {
@@ -2734,11 +2741,15 @@ static void update_strings_charts() {
, RRDSET_TYPE_AREA);
rd_entries_entries = rrddim_add(st_entries, "entries", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
+#ifdef NETDATA_INTERNAL_CHECKS
rd_entries_refs = rrddim_add(st_entries, "references", NULL, 1, -1, RRD_ALGORITHM_ABSOLUTE);
+#endif
}
rrddim_set_by_pointer(st_entries, rd_entries_entries, (collected_number)entries);
+#ifdef NETDATA_INTERNAL_CHECKS
rrddim_set_by_pointer(st_entries, rd_entries_refs, (collected_number)references);
+#endif
rrdset_done(st_entries);
if (unlikely(!st_mem)) {
@@ -2813,6 +2824,7 @@ struct dictionary_stats dictionary_stats_category_rrdhealth = { .name = "health"
struct dictionary_stats dictionary_stats_category_functions = { .name = "functions" };
struct dictionary_stats dictionary_stats_category_replication = { .name = "replication" };
+#ifdef DICT_WITH_STATS
struct dictionary_categories {
struct dictionary_stats *stats;
const char *family;
@@ -3165,6 +3177,13 @@ static void update_dictionary_category_charts(struct dictionary_categories *c) {
}
}
+static void dictionary_statistics(void) {
+ for(int i = 0; dictionary_categories[i].stats ;i++) {
+ update_dictionary_category_charts(&dictionary_categories[i]);
+ }
+}
+#endif // DICT_WITH_STATS
+
#ifdef NETDATA_TRACE_ALLOCATIONS
struct memory_trace_data {
@@ -3304,12 +3323,6 @@ static void malloc_trace_statistics(void) {
}
#endif
-static void dictionary_statistics(void) {
- for(int i = 0; dictionary_categories[i].stats ;i++) {
- update_dictionary_category_charts(&dictionary_categories[i]);
- }
-}
-
// ---------------------------------------------------------------------------------------------------------------------
// worker utilization
@@ -4171,8 +4184,10 @@ void *global_statistics_main(void *ptr)
worker_is_busy(WORKER_JOB_STRINGS);
update_strings_charts();
+#ifdef DICT_WITH_STATS
worker_is_busy(WORKER_JOB_DICTIONARIES);
dictionary_statistics();
+#endif
#ifdef NETDATA_TRACE_ALLOCATIONS
worker_is_busy(WORKER_JOB_MALLOC_TRACE);