From ad13abd675ba9cc2a4a771c70d306181635169f7 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 8 May 2017 09:03:29 +0000 Subject: [PATCH] remove GAP_SEQUENCE statistic --- include/villas/stats.h | 3 +-- lib/stats.c | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/villas/stats.h b/include/villas/stats.h index 828509ff9..0741d48b8 100644 --- a/include/villas/stats.h +++ b/include/villas/stats.h @@ -46,7 +46,6 @@ enum stats_format { enum stats_id { STATS_SKIPPED, /**< Counter for skipped samples due to hooks. */ STATS_REORDERED, /**< Counter for reordered samples. */ - STATS_GAP_SEQUENCE, /**< Histogram of sequence number displacement of received samples. */ STATS_GAP_SAMPLE, /**< Histogram for inter sample timestamps (as sent by remote). */ STATS_GAP_RECEIVED, /**< Histogram for inter sample arrival time (as seen by this instance). */ STATS_OWD, /**< Histogram for one-way-delay (OWD) of received samples. */ @@ -92,4 +91,4 @@ void stats_send(struct stats *s, struct node *n); enum stats_id stats_lookup_id(const char *name); -#endif /* _STATS_H_ */ \ No newline at end of file +#endif /* _STATS_H_ */ diff --git a/lib/stats.c b/lib/stats.c index 9090e6d08..c4c0d8396 100644 --- a/lib/stats.c +++ b/lib/stats.c @@ -90,11 +90,10 @@ void stats_collect(struct stats_delta *s, struct sample *smps[], size_t cnt) if (previous) { stats_update(s, STATS_GAP_RECEIVED, time_delta(&previous->ts.received, &smps[i]->ts.received)); stats_update(s, STATS_GAP_SAMPLE, time_delta(&previous->ts.origin, &smps[i]->ts.origin)); - stats_update(s, STATS_OWD, -time_delta(&smps[i]->ts.origin, &smps[i]->ts.received)); - stats_update(s, STATS_GAP_SEQUENCE, smps[i]->sequence - (int32_t) previous->sequence); + stats_update(s, STATS_OWD, time_delta(&smps[i]->ts.origin, &smps[i]->ts.received)); dist = smps[i]->sequence - (int32_t) previous->sequence; - if (dist > 0) + if (dist != 1) stats_update(s, STATS_REORDERED, dist); }