mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-23 06:36:17 -07:00
usr/lib/byobu/disk_io: fix scaling, LP: #787773
This commit is contained in:
parent
b2e6ca37d4
commit
18d24bbb76
2 changed files with 8 additions and 3 deletions
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -2,6 +2,7 @@ byobu (4.3) unreleased; urgency=low
|
||||||
|
|
||||||
* usr/lib/byobu/uptime: fix string bug in uptime introduced by smoser's
|
* usr/lib/byobu/uptime: fix string bug in uptime introduced by smoser's
|
||||||
changes
|
changes
|
||||||
|
* usr/lib/byobu/disk_io: fix scaling, LP: #787773
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 23 May 2011 19:21:36 -0500
|
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 23 May 2011 19:21:36 -0500
|
||||||
|
|
||||||
|
|
|
@ -73,15 +73,19 @@ for i in "read" "write"; do
|
||||||
x2="$a7"
|
x2="$a7"
|
||||||
fi
|
fi
|
||||||
echo "$x2" > "$cache"
|
echo "$x2" > "$cache"
|
||||||
rate=$((($x2-$x1) / ($t2 - $t1) * 512 / 1024))
|
rate=$((($x2 - $x1) / ($t2 - $t1) * 512 / 1024))
|
||||||
if [ "$rate" -lt 0 ]; then
|
if [ "$rate" -lt 0 ]; then
|
||||||
rate=0
|
rate=0
|
||||||
elif [ "$rate" -gt 1048576 ]; then
|
elif [ "$rate" -gt 1048576 ]; then
|
||||||
fpdiv "$rate" 1048576 1
|
|
||||||
unit="GB/s"
|
unit="GB/s"
|
||||||
|
fpdiv "$rate" 1048576 0
|
||||||
|
rate=${_RET}
|
||||||
elif [ "$rate" -gt 1024 ]; then
|
elif [ "$rate" -gt 1024 ]; then
|
||||||
fpdiv "$rate" 1024 1
|
|
||||||
unit="MB/s"
|
unit="MB/s"
|
||||||
|
fpdiv "$rate" 1024 0
|
||||||
|
rate=${_RET}
|
||||||
|
else
|
||||||
|
unit="kB/s"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
[ "$rate" != "0" ] || continue
|
[ "$rate" != "0" ] || continue
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue