You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/06/11 12:52:13 UTC

[incubator-nuttx-apps] 02/05: iperf_report_task: print the number of bytes transferred

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit d2b7d79f1df12f616ee125b56036bb61aa23026f
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Jun 10 13:28:51 2021 +0900

    iperf_report_task: print the number of bytes transferred
---
 netutils/iperf/iperf.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/netutils/iperf/iperf.c b/netutils/iperf/iperf.c
index de22995..2cc4853 100644
--- a/netutils/iperf/iperf.c
+++ b/netutils/iperf/iperf.c
@@ -241,7 +241,7 @@ static void iperf_report_task(void *arg)
     }
 
   start = now;
-  printf("\n%16s %s\n", "Interval", "Bandwidth\n");
+  printf("\n%19s %16s %18s\n", "Interval", "Transfer", "Bandwidth\n");
   while (!s_iperf_ctrl.finish)
     {
       uintmax_t last_len;
@@ -258,9 +258,10 @@ static void iperf_report_task(void *arg)
           exit(EXIT_FAILURE);
         }
 
-      printf("%4.2lf-%4.2lf sec,  %.2f Mbits/sec\n",
+      printf("%7.2lf-%7.2lf sec %10ju Bytes %7.2f Mbits/sec\n",
              ts_diff(&last, &start),
              ts_diff(&now, &start),
+             now_len,
              (((double)(now_len - last_len) * 8) /
              ts_diff(&now, &last) / 1e6));
       if (ts_diff(&now, &start) >= time)
@@ -271,9 +272,10 @@ static void iperf_report_task(void *arg)
 
   if (ts_diff(&now, &start) > 0)
     {
-      printf("%4.2lf-%4.2lf sec,  %.2f Mbits/sec\n",
+      printf("%7.2lf-%7.2lf sec %10ju Bytes %7.2f Mbits/sec\n",
              ts_diff(&start, &start),
              ts_diff(&now, &start),
+             now_len,
              (((double)now_len * 8) /
              ts_diff(&now, &start) / 1e6));
     }