From 755c3e93f4787b04ef57a757941b6df30294dcdd Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sat, 22 Aug 2015 17:39:06 +0200 Subject: [PATCH] fix: suppres statistic output if no samples have been received --- server/include/hist.h | 2 +- server/src/stats.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/include/hist.h b/server/include/hist.h index 3b0d33c93..50386a32c 100644 --- a/server/include/hist.h +++ b/server/include/hist.h @@ -35,7 +35,7 @@ struct hist { /** The number of buckets in #data. */ int length; - /** Total number of counted values between #low and #high. */ + /** Total number of counted values. */ hist_cnt_t total; /** The number of values which are higher than #high. */ hist_cnt_t higher; diff --git a/server/src/stats.c b/server/src/stats.c index 527280382..a06b125ea 100644 --- a/server/src/stats.c +++ b/server/src/stats.c @@ -32,9 +32,9 @@ int stats_line(struct path *p) int stats_show(struct path *p) { - if (p->hist_delay.length) { info("One-way delay:"); hist_print(&p->hist_delay); } - if (p->hist_gap.length) { info("Message gap time:"); hist_print(&p->hist_gap); } - if (p->hist_sequence.length) { info("Sequence number gaps:"); hist_print(&p->hist_sequence); } + if (p->hist_delay.total) { info("One-way delay:"); hist_print(&p->hist_delay); } + if (p->hist_gap.total) { info("Message gap time:"); hist_print(&p->hist_gap); } + if (p->hist_sequence.total) { info("Sequence number gaps:"); hist_print(&p->hist_sequence); } return 0; }