From a5f634ee283e37cea3713f90ac7782e197cf66e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Wed, 18 Apr 2018 16:37:20 +0000 Subject: [PATCH] Show rate per path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- mud | 2 +- src/path.c | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/mud b/mud index 1f25f12..a7044db 160000 --- a/mud +++ b/mud @@ -1 +1 @@ -Subproject commit 1f25f12e4a02e5a13bc0bfa7302d09cd7d11601d +Subproject commit a7044db87cfbcefd9a89be8ab424132cbdd74d8a diff --git a/src/path.c b/src/path.c index 217df37..20e4086 100644 --- a/src/path.c +++ b/src/path.c @@ -48,14 +48,16 @@ gt_path_status(int fd) } printf("path %s\n" - " bind: %s port %"PRIu16"\n" - " public: %s port %"PRIu16"\n" - " peer: %s port %"PRIu16"\n" - " mtu: %zu bytes\n" - " rtt: %.3f ms\n" - " rttvar: %.3f ms\n" - " output: %"PRIu64" packets\n" - " input: %"PRIu64" packets\n", + " bind: %s port %"PRIu16"\n" + " public: %s port %"PRIu16"\n" + " peer: %s port %"PRIu16"\n" + " mtu: %zu bytes\n" + " rtt: %.3f ms\n" + " rttvar: %.3f ms\n" + " upload: %"PRIu64" bytes/s\n" + " download: %"PRIu64" bytes/s\n" + " output: %"PRIu64" packets\n" + " input: %"PRIu64" packets\n", statestr, bindstr[0] ? bindstr : "-", gt_get_port((struct sockaddr *)&res.path_status.local_addr), @@ -66,6 +68,8 @@ gt_path_status(int fd) res.path_status.mtu.ok, res.path_status.rtt/(double)1e3, res.path_status.rttvar/(double)1e3, + res.path_status.r_rate, + res.path_status.recv.rate, res.path_status.send.total, res.path_status.recv.total); } while (res.ret == EAGAIN);