diff --git a/include/villas/stats.h b/include/villas/stats.h index b3ce20138..ec2fdcc16 100644 --- a/include/villas/stats.h +++ b/include/villas/stats.h @@ -46,8 +46,9 @@ enum stats_format { enum stats_metric { STATS_METRIC_INVALID = -1, - STATS_METRIC_SKIPPED, /**< Counter for skipped samples due to hooks. */ - STATS_METRIC_REORDERED, /**< Counter for reordered samples. */ + + STATS_METRIC_SMPS_SKIPPED, /**< Counter for skipped samples due to hooks. */ + STATS_METRIC_SMPS_REORDERED, /**< Counter for reordered samples. */ STATS_METRIC_GAP_SAMPLE, /**< Histogram for inter sample timestamps (as sent by remote). */ STATS_METRIC_GAP_RECEIVED, /**< Histogram for inter sample arrival time (as seen by this instance). */ STATS_METRIC_OWD, /**< Histogram for one-way-delay (OWD) of received samples. */ diff --git a/lib/hooks/stats.cpp b/lib/hooks/stats.cpp index be45d7c81..c96d30819 100644 --- a/lib/hooks/stats.cpp +++ b/lib/hooks/stats.cpp @@ -183,7 +183,7 @@ public: if (smp->flags & last->flags & SAMPLE_HAS_SEQUENCE) { int dist = smp->sequence - (int32_t) last->sequence; if (dist != 1) - stats_update(s, STATS_METRIC_REORDERED, dist); + stats_update(s, STATS_METRIC_SMPS_REORDERED, dist); } } diff --git a/lib/node.c b/lib/node.c index ef4eeb23f..b2a22515d 100644 --- a/lib/node.c +++ b/lib/node.c @@ -424,7 +424,7 @@ int node_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *rel int skipped = nread - rread; if (skipped > 0 && n->stats != NULL) { - stats_update(n->stats, STATS_METRIC_SKIPPED, skipped); + stats_update(n->stats, STATS_METRIC_SMPS_SKIPPED, skipped); } debug(LOG_NODE | 5, "Received %u samples from node %s of which %d have been skipped", nread, node_name(n), skipped); diff --git a/lib/stats.c b/lib/stats.c index c04f564e8..88ef632f6 100644 --- a/lib/stats.c +++ b/lib/stats.c @@ -32,11 +32,11 @@ #include struct stats_metric_description stats_metrics[] = { - { "skipped", STATS_METRIC_SKIPPED, "samples", "Skipped samples and the distance between them", 25 }, - { "reordered", STATS_METRIC_REORDERED, "samples", "Reordered samples and the distance between them", 25 }, - { "gap_sent", STATS_METRIC_GAP_SAMPLE, "seconds", "Inter-message timestamps (as sent by remote)", 25 }, - { "gap_received", STATS_METRIC_GAP_RECEIVED, "seconds", "Inter-message arrival time (as received by this instance)", 25 }, - { "owd", STATS_METRIC_OWD, "seconds", "One-way-delay (OWD) of received messages", 25 } + { "skipped", STATS_METRIC_SMPS_SKIPPED, "samples", "Skipped samples and the distance between them", 25 }, + { "reordered", STATS_METRIC_SMPS_REORDERED, "samples", "Reordered samples and the distance between them", 25 }, + { "gap_sent", STATS_METRIC_GAP_SAMPLE, "seconds", "Inter-message timestamps (as sent by remote)", 25 }, + { "gap_received", STATS_METRIC_GAP_RECEIVED, "seconds", "Inter-message arrival time (as received by this instance)", 25 }, + { "owd", STATS_METRIC_OWD, "seconds", "One-way-delay (OWD) of received messages", 25 }, }; struct stats_type_description stats_types[] = { @@ -141,8 +141,8 @@ json_t * stats_json_periodic(struct stats *s, struct node *n) "processed", hist_total(&s->histograms[STATS_METRIC_OWD]), "owd", hist_last(&s->histograms[STATS_METRIC_OWD]), "rate", 1.0 / hist_last(&s->histograms[STATS_METRIC_GAP_SAMPLE]), - "dropped", hist_total(&s->histograms[STATS_METRIC_REORDERED]), - "skipped", hist_total(&s->histograms[STATS_METRIC_SKIPPED]) + "dropped", hist_total(&s->histograms[STATS_METRIC_SMPS_REORDERED]), + "skipped", hist_total(&s->histograms[STATS_METRIC_SMPS_SKIPPED]) ); } @@ -195,8 +195,8 @@ void stats_print_periodic(struct stats *s, FILE *f, enum stats_format fmt, int v hist_mean(&s->histograms[STATS_METRIC_OWD]), 1.0 / hist_last(&s->histograms[STATS_METRIC_GAP_RECEIVED]), 1.0 / hist_mean(&s->histograms[STATS_METRIC_GAP_RECEIVED]), - hist_total(&s->histograms[STATS_METRIC_REORDERED]), - hist_total(&s->histograms[STATS_METRIC_SKIPPED]) + hist_total(&s->histograms[STATS_METRIC_SMPS_REORDERED]), + hist_total(&s->histograms[STATS_METRIC_SMPS_SKIPPED]) ); break;