summaryrefslogtreecommitdiffstats
path: root/DiskIOMeter.c
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2022-11-07 11:59:07 +0100
committerBenBE <BenBE@geshi.org>2022-12-06 14:56:48 +0100
commit078a7657f2189895d2d5a8e931ca413841e5d5ed (patch)
treee0502f2112b598cf7909d9456dec344195440e7f /DiskIOMeter.c
parent21e2875570e6dc0499f571950532c0f7f33e524d (diff)
DiskIOMeter: convert to bytes per second
... do not show values per interval (which is 1.5 seconds by default).
Diffstat (limited to 'DiskIOMeter.c')
-rw-r--r--DiskIOMeter.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/DiskIOMeter.c b/DiskIOMeter.c
index 925a2c41..1adce8e0 100644
--- a/DiskIOMeter.c
+++ b/DiskIOMeter.c
@@ -64,6 +64,7 @@ static void DiskIOMeter_updateValues(Meter* this) {
if (data.totalBytesRead > cached_read_total) {
diff = data.totalBytesRead - cached_read_total;
+ diff = (1000 * diff) / passedTimeInMs; /* convert to B/s */
diff /= ONE_K; /* convert to KiB/s */
cached_read_diff = (uint32_t)diff;
} else {
@@ -73,6 +74,7 @@ static void DiskIOMeter_updateValues(Meter* this) {
if (data.totalBytesWritten > cached_write_total) {
diff = data.totalBytesWritten - cached_write_total;
+ diff = (1000 * diff) / passedTimeInMs; /* convert to B/s */
diff /= ONE_K; /* convert to KiB/s */
cached_write_diff = (uint32_t)diff;
} else {

© 2014-2024 Faster IT GmbH | imprint | privacy policy