summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-01-24 11:20:47 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-01-24 11:20:47 +0000
commit73e37073b79fa338ba9c9831270f6a98fe1999ec (patch)
treecf8308ba01fc98e5d4e2507502a09c8b0aa35ae9 /sbin
parent873d85cbe0ff9ef3979abe4731a0bd7b718cc88f (diff)
pfctl -vvsq shows bandwidth and packets/s for PRIQ now too
Diffstat (limited to 'sbin')
-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