From 211af11eabdfa1226ee2c7aec25002a1d7b25567 Mon Sep 17 00:00:00 2001 Message-Id: <211af11eabdfa1226ee2c7aec25002a1d7b25567.1714061445.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sat, 11 Apr 2009 16:46:27 +0100 Subject: [PATCH] Compute rate over a longer interval. Organization: Straylight/Edgeware From: Richard Kettlewell --- clients/rtpmon.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/clients/rtpmon.c b/clients/rtpmon.c index cf83328..070d21c 100644 --- a/clients/rtpmon.c +++ b/clients/rtpmon.c @@ -61,7 +61,7 @@ static unsigned bpf = 4; static uint32_t serial; /** @brief Size of ring buffer */ -#define RINGSIZE 16384 +#define RINGSIZE 131072 /** @brief Ring buffer */ static struct entry ring[RINGSIZE]; @@ -112,7 +112,15 @@ static void frames(const struct timeval *when, size_t n) { ringtail = (ringtail + 1) % RINGSIZE; // Report once a second if(prev != when->tv_sec) { - if(printf("%8.2f %8.2f %8.2f\n", + if(printf("%8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f\n", + rate((ringtail - RINGSIZE / 128) % RINGSIZE, + (ringtail - 1) % RINGSIZE), + rate((ringtail - RINGSIZE / 64) % RINGSIZE, + (ringtail - 1) % RINGSIZE), + rate((ringtail - RINGSIZE / 32) % RINGSIZE, + (ringtail - 1) % RINGSIZE), + rate((ringtail - RINGSIZE / 16) % RINGSIZE, + (ringtail - 1) % RINGSIZE), rate((ringtail - RINGSIZE / 8) % RINGSIZE, (ringtail - 1) % RINGSIZE), rate((ringtail - RINGSIZE / 4) % RINGSIZE, -- [mdw]