summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2003-01-24 11:20:46 +0000
committerhenning <henning@openbsd.org>2003-01-24 11:20:46 +0000
commit43971518b249196e6bcfe8f633aa3fd9ee032f3d (patch)
treec41a8fbf279192d86b64fdcaf0c6017eacfe20b8
parentlet pfctl -vvsq loop and display measured bandwidth and packets/s per queue. (diff)
downloadwireguard-openbsd-43971518b249196e6bcfe8f633aa3fd9ee032f3d.tar.xz
wireguard-openbsd-43971518b249196e6bcfe8f633aa3fd9ee032f3d.zip
pfctl -vvsq shows bandwidth and packets/s for PRIQ now too
-rw-r--r--sbin/pfctl/pfctl_qstats.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sbin/pfctl/pfctl_qstats.c b/sbin/pfctl/pfctl_qstats.c
index 96542ea977e..5aea29a1502 100644
--- a/sbin/pfctl/pfctl_qstats.c
+++ b/sbin/pfctl/pfctl_qstats.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_qstats.c,v 1.10 2003/01/24 11:11:17 henning Exp $ */
+/* $OpenBSD: pfctl_qstats.c,v 1.11 2003/01/24 11:20:46 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer
@@ -295,6 +295,8 @@ print_cbqstats(struct queue_stats cur, struct queue_stats last)
void
print_priqstats(struct queue_stats cur, struct queue_stats last)
{
+ double interval;
+
printf("[ pkts: %10llu bytes: %10llu "
"dropped pkts: %6llu bytes: %6llu ]\n",
cur.data.priq_stats.xmitcnt.packets,
@@ -303,6 +305,16 @@ print_priqstats(struct queue_stats cur, struct queue_stats last)
cur.data.priq_stats.dropcnt.bytes);
printf("[ qlength: %3d/%3d ]\n",
cur.data.priq_stats.qlength, cur.data.priq_stats.qlimit);
+
+ if (!last.valid)
+ return;
+
+ interval = calc_interval(&cur.timestamp, &last.timestamp);
+ printf("[ measured: %7.1f packets/s, %s/s ]\n",
+ calc_pps(cur.data.priq_stats.xmitcnt.packets,
+ last.data.priq_stats.xmitcnt.packets, interval),
+ rate2str(calc_rate(cur.data.priq_stats.xmitcnt.bytes,
+ last.data.priq_stats.xmitcnt.bytes, interval)));
}
void