summaryrefslogtreecommitdiffstats
path: root/usr.bin/systat
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-04-09 07:49:43 +0000
committerphk <phk@FreeBSD.org>2003-04-09 07:49:43 +0000
commit4f7670814909e9332ee3cd781b82d298aabaf214 (patch)
tree205e9cfa5073f60a9b36f79affd3c2b9258b3148 /usr.bin/systat
parentbd7b2f8fd040fdb4f67855f55df891bb31fb0da9 (diff)
downloadFreeBSD-src-4f7670814909e9332ee3cd781b82d298aabaf214.zip
FreeBSD-src-4f7670814909e9332ee3cd781b82d298aabaf214.tar.gz
Let libdevstat calculate the device-busy % instead of home-rolling.
Diffstat (limited to 'usr.bin/systat')
-rw-r--r--usr.bin/systat/vmstat.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index ff7a37b..92a5e83 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -855,32 +855,24 @@ dinfo(dn, lc, now, then)
if (then != NULL) {
/* Calculate relative to previous sample */
elapsed_time = now->snap_time - then->snap_time;
- device_busy = devstat_compute_etime(
- &now->dinfo->devices[di].busy_time,
- &then->dinfo->devices[di].busy_time);
} else {
/* Calculate relative to device creation */
elapsed_time = now->snap_time - devstat_compute_etime(
&now->dinfo->devices[di].creation_time, NULL);
- device_busy = devstat_compute_etime(
- &now->dinfo->devices[di].busy_time, NULL);
}
if (devstat_compute_statistics(&now->dinfo->devices[di], then ?
&then->dinfo->devices[di] : NULL, elapsed_time,
- DSM_KB_PER_TRANSFER, &kb_per_transfer, DSM_TRANSFERS_PER_SECOND,
- &transfers_per_second, DSM_MB_PER_SECOND, &mb_per_second,
+ DSM_KB_PER_TRANSFER, &kb_per_transfer,
+ DSM_TRANSFERS_PER_SECOND, &transfers_per_second,
+ DSM_MB_PER_SECOND, &mb_per_second,
+ DSM_BUSY_PCT, &device_busy,
DSM_NONE) != 0)
errx(1, "%s", devstat_errbuf);
- if (device_busy > elapsed_time)
- /* this normally happens after one or more periods
- * where the device has been 100% busy, correct it */
- device_busy = elapsed_time;
-
lc = DISKCOL + lc * 6;
putlongdouble(kb_per_transfer, DISKROW + 1, lc, 5, 2, 0);
putlongdouble(transfers_per_second, DISKROW + 2, lc, 5, 0, 0);
putlongdouble(mb_per_second, DISKROW + 3, lc, 5, 2, 0);
- putlongdouble(device_busy * 100 / elapsed_time, DISKROW + 4, lc, 5, 0, 0);
+ putlongdouble(device_busy, DISKROW + 4, lc, 5, 0, 0);
}
OpenPOWER on IntegriCloud