1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

stats: refactor STATS_METRIC_ => STATS_METRIC_SMPS

This commit is contained in:
Steffen Vogel 2019-03-29 09:46:57 +01:00
parent cad22a02bd
commit 7e8d94b55b
4 changed files with 14 additions and 13 deletions

View file

@ -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. */

View file

@ -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);
}
}

View file

@ -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);

View file

@ -32,11 +32,11 @@
#include <villas/table.h>
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;