summaryrefslogtreecommitdiffstats
path: root/libnetdata
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2023-09-13 13:30:32 +0300
committerGitHub <noreply@github.com>2023-09-13 13:30:32 +0300
commitfe3dd763a905493d545eb771631760921f6bdb3a (patch)
tree5b7f32f880c821c1569c7d775f5ffeadf66c20df /libnetdata
parent512aeb59efea55c7abc92fa95ec0c27ebd2d3b76 (diff)
facets and journal improvements (#15956)
Diffstat (limited to 'libnetdata')
-rw-r--r--libnetdata/facets/facets.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libnetdata/facets/facets.c b/libnetdata/facets/facets.c
index 7496072c78..11d28ebfe9 100644
--- a/libnetdata/facets/facets.c
+++ b/libnetdata/facets/facets.c
@@ -1,6 +1,6 @@
#include "facets.h"
-#define HISTOGRAM_COLUMNS 60
+#define HISTOGRAM_COLUMNS 100
static void facets_row_free(FACETS *facets __maybe_unused, FACET_ROW *row);
@@ -1472,7 +1472,20 @@ void facets_report(FACETS *facets, BUFFER *wb) {
buffer_json_member_add_array(wb, "data");
{
+ usec_t last_usec = 0;
+
for(FACET_ROW *row = facets->base ; row ;row = row->next) {
+
+ internal_fatal(
+ facets->anchor.key && (
+ (facets->anchor.direction == FACETS_ANCHOR_DIRECTION_BACKWARD && row->usec >= facets->anchor.key) ||
+ (facets->anchor.direction == FACETS_ANCHOR_DIRECTION_FORWARD && row->usec <= facets->anchor.key)
+ ), "Wrong data returned related to %s anchor!", facets->anchor.direction == FACETS_ANCHOR_DIRECTION_FORWARD ? "forward" : "backward");
+
+ internal_fatal(last_usec && row->usec > last_usec, "Wrong order of data returned!");
+
+ last_usec = row->usec;
+
buffer_json_add_array_item_array(wb); // each row
buffer_json_add_array_item_uint64(wb, row->usec);