summaryrefslogtreecommitdiff
path: root/src/tools/ocbr/ocbr_server.c
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2018-10-06 18:06:47 +0200
committerDimitri Staessens <[email protected]>2018-10-06 18:06:47 +0200
commit0b2e5c5410580c755cef02114e51f15b19cfaffa (patch)
tree63d684e6057c9caa43739b599d54a72f9959d4f8 /src/tools/ocbr/ocbr_server.c
parentbfc29ca20406ccd69363b0f9796987534318e7ae (diff)
parentd9ad3852613cda026d4520b5c608ada7433dd7d9 (diff)
downloadouroboros-0b2e5c5410580c755cef02114e51f15b19cfaffa.tar.gz
ouroboros-0b2e5c5410580c755cef02114e51f15b19cfaffa.zip
Merge branch 'testing' into be
Diffstat (limited to 'src/tools/ocbr/ocbr_server.c')
-rw-r--r--src/tools/ocbr/ocbr_server.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/tools/ocbr/ocbr_server.c b/src/tools/ocbr/ocbr_server.c
index 4f080eff..75983201 100644
--- a/src/tools/ocbr/ocbr_server.c
+++ b/src/tools/ocbr/ocbr_server.c
@@ -90,8 +90,8 @@ static void handle_flow(int fd)
bool stop = false;
- long sdus = 0;
- long sdus_intv = 0;
+ long packets = 0;
+ long packets_intv = 0;
long bytes_read = 0;
long bytes_read_intv = 0;
@@ -109,7 +109,7 @@ static void handle_flow(int fd)
if (count > 0) {
clock_gettime(CLOCK_REALTIME, &alive);
- sdus++;
+ packets++;
bytes_read += count;
}
@@ -121,17 +121,18 @@ static void handle_flow(int fd)
if (stop || ts_diff_ms(&now, &iv_end) < 0) {
long us = ts_diff_us(&iv_start, &now);
- printf("Flow %4d: %9ld SDUs (%12ld bytes) in %9ld ms"
- " => %9.4f p/s, %9.4f Mb/s\n",
+ printf("Flow %4d: %9ld packets (%12ld bytes) in %9ld ms"
+ " => %9.4f pps, %9.4f Mbps\n",
fd,
- sdus - sdus_intv,
+ packets - packets_intv,
bytes_read - bytes_read_intv,
us / 1000,
- ((sdus - sdus_intv) / (double) us) * MILLION,
+ ((packets - packets_intv) / (double) us)
+ * MILLION,
8 * ((bytes_read - bytes_read_intv)
/ (double)(us)));
iv_start = iv_end;
- sdus_intv = sdus;
+ packets_intv = packets;
bytes_read_intv = bytes_read;
ts_add(&iv_start, &intv, &iv_end);
}