summaryrefslogtreecommitdiffstats
path: root/libnetdata/facets
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-17 10:46:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-17 10:46:12 +0000
commit51dfb248933e5fac12fee1be8471bb08f9554428 (patch)
tree1d25518313ca94af4257e56ef919605a219a4178 /libnetdata/facets
parentAdding upstream version 1.42.0. (diff)
downloadnetdata-upstream/1.42.1.tar.xz
netdata-upstream/1.42.1.zip
Adding upstream version 1.42.1.upstream/1.42.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libnetdata/facets')
-rw-r--r--libnetdata/facets/facets.c10
-rw-r--r--libnetdata/facets/facets.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/libnetdata/facets/facets.c b/libnetdata/facets/facets.c
index 8762b43b9..b285baf03 100644
--- a/libnetdata/facets/facets.c
+++ b/libnetdata/facets/facets.c
@@ -1,6 +1,5 @@
#include "facets.h"
-#define FACET_VALUE_UNSET "-"
#define HISTOGRAM_COLUMNS 60
static void facets_row_free(FACETS *facets __maybe_unused, FACET_ROW *row);
@@ -197,14 +196,14 @@ static void facet_value_insert_callback(const DICTIONARY_ITEM *item __maybe_unus
FACET_VALUE *v = value;
FACET_KEY *k = data;
+ if(!v->selected)
+ v->selected = k->default_selected_for_values;
+
if(v->name) {
// an actual value, not a filter
v->name = strdupz(v->name);
facet_value_is_used(k, v);
}
-
- if(!v->selected)
- v->selected = k->default_selected_for_values;
}
static bool facet_value_conflict_callback(const DICTIONARY_ITEM *item __maybe_unused, void *old_value, void *new_value, void *data) {
@@ -219,6 +218,9 @@ static bool facet_value_conflict_callback(const DICTIONARY_ITEM *item __maybe_un
if(v->name)
facet_value_is_used(k, v);
+ internal_fatal(v->name && strcmp(v->name, nv->name) != 0, "hash conflict: '%s' and '%s' have the same hash '%s'", v->name, nv->name,
+ dictionary_acquired_item_name(item));
+
return false;
}
diff --git a/libnetdata/facets/facets.h b/libnetdata/facets/facets.h
index c0f7f80c8..796d15a04 100644
--- a/libnetdata/facets/facets.h
+++ b/libnetdata/facets/facets.h
@@ -3,6 +3,8 @@
#include "../libnetdata.h"
+#define FACET_VALUE_UNSET "-"
+
typedef enum __attribute__((packed)) {
FACET_KEY_OPTION_FACET = (1 << 0), // filterable values
FACET_KEY_OPTION_NO_FACET = (1 << 1), // non-filterable value