Reduce the number of messages logged to one that sums up the numbr of metrics ignored (#12829)
Stelios Fragkakis committed
May 5, 2022 at 19:49 UTC
d97572725a5fe1b04a3fe1389d071dec5cbb789d
1 file changed
+4
-1
database/engine/rrdengineapi.c
+4
-1
@@ -407,6 +407,7 @@ unsigned rrdeng_variable_step_boundaries(RRDSET *st, time_t start_time, time_t e
407
is_first_region_initialized = 0;
408
region_points = 0;
409
410
+ int is_out_of_order_reported = 0;
411
/* pages loop */
412
for (i = 0, curr = NULL, prev = NULL ; i < pages_nr ; ++i) {
413
old_prev = prev;
@@ -447,7 +448,7 @@ unsigned rrdeng_variable_step_boundaries(RRDSET *st, time_t start_time, time_t e
448
is_metric_out_of_order = 1;
449
if (is_metric_earlier_than_range || unlikely(is_metric_out_of_order)) {
450
if (unlikely(is_metric_out_of_order))
450
- info("Ignoring metric with out of order timestamp.");
451
+ is_out_of_order_reported++;
452
continue; /* next entry */
453
}
454
/* here is a valid metric */
@@ -520,6 +521,8 @@ unsigned rrdeng_variable_step_boundaries(RRDSET *st, time_t start_time, time_t e
521
freez(region_info_array);
522
}
523
}
524
+ if (is_out_of_order_reported)
525
+ info("Ignored %d metrics with out of order timestamp in %u regions.", is_out_of_order_reported, regions);
526
return regions;
527
}
528