that minimum hours is 1, not 0; LP: #639855

* usr/lib/byobu/network: use bps rather than B/s by default for network
traffic, LP: #578377
This commit is contained in:
Dustin Kirkland 2010-09-15 13:24:34 -06:00
commit 9c8145a3ed
3 changed files with 23 additions and 12 deletions

4
debian/changelog vendored
View file

@ -7,7 +7,9 @@ byobu (3.5) unreleased; urgency=low
* usr/lib/byobu/rcs_cost, usr/lib/byobu/ec2_cost: testing crontab * usr/lib/byobu/rcs_cost, usr/lib/byobu/ec2_cost: testing crontab
creation time is not accurate, seems this happens at image creation creation time is not accurate, seems this happens at image creation
rather than instance instantiation; use /etc/hostname instead; ensure rather than instance instantiation; use /etc/hostname instead; ensure
that minimum hours is 1, not 0 that minimum hours is 1, not 0; LP: #639855
* usr/lib/byobu/network: use bps rather than B/s by default for network
traffic, LP: #578377
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 01 Sep 2010 13:11:34 -0600 -- Dustin Kirkland <kirkland@ubuntu.com> Wed, 01 Sep 2010 13:11:34 -0600

View file

@ -53,21 +53,30 @@ for i in up down; do
if [ "$rate" -lt 0 ]; then if [ "$rate" -lt 0 ]; then
rate=0 rate=0
fi fi
# Why 1000 and not 1024? http://en.wikipedia.org/wiki/Data_rate_units
case "$NETWORK_UNITS" in case "$NETWORK_UNITS" in
bits) bytes)
rate=`echo "$rate" | awk '{printf "%.0f", $1*8}'` if [ "$rate" -gt 1048576 ]; then
unit="kbps" rate=`echo "$rate" | awk '{printf "%.1f", $1/1048576}'`
if [ "$rate" -gt 1000 ]; then unit="GB/s"
rate=`echo "$rate" | awk '{printf "%.1f", $1/1000}'` elif [ "$rate" -gt 1024 ]; then
unit="Mbps" rate=`echo "$rate" | awk '{printf "%.1f", $1/1024}'`
unit="MB/s"
else
unit="kB/s"
fi fi
;; ;;
*) *)
unit="kB/s" # Default to bps
if [ "$rate" -gt 1024 ]; then rate=`echo "$rate" | awk '{printf "%.0f", $1*8}'`
# Why 1000 and not 1024? http://en.wikipedia.org/wiki/Data_rate_units
if [ "$rate" -gt 1000000 ]; then
rate=`echo "$rate" | awk '{printf "%.1f", $1/1000000}'`
unit="Gbps"
elif [ "$rate" -gt 1000 ]; then
rate=`echo "$rate" | awk '{printf "%.1f", $1/1000}'` rate=`echo "$rate" | awk '{printf "%.1f", $1/1000}'`
unit="MB/s" unit="Mbps"
else
unit="kbps"
fi fi
;; ;;
esac esac

View file

@ -56,7 +56,7 @@ byobu \- wrapper script for seeding a user's byobu configuration and launching s
\fBmenu\fP \- a simple indicator directing new users to use the F9 keybinding to access the byobu menu \fBmenu\fP \- a simple indicator directing new users to use the F9 keybinding to access the byobu menu
\fBnetwork\fP \- instantaneous upload/download bandwidth in kB/s over the last 3 seconds; displayed in the lower bar toward the right in white text on a purple background with a leading '^' sign indicating 'up' and 'v' sign indicating 'down'; override the default interface by specifying an alternate interface with MONITORED_NETWORK=eth1, and override the default units (kB/s) with NETWORK_UNITS=bits in \fI$HOME/.byobu/statusrc\fP \fBnetwork\fP \- instantaneous upload/download bandwidth in [GMk]bps over the last 3 seconds; displayed in the lower bar toward the right in white text on a purple background with a leading '^' sign indicating 'up' and 'v' sign indicating 'down'; override the default interface by specifying an alternate interface with MONITORED_NETWORK=eth1, and override the default units (bits) with NETWORK_UNITS=bytes in \fI$HOME/.byobu/statusrc\fP
\fBprocesses\fP \- total number of processes running on the system; displayed in the lower bar in white text on a dark yellow background with a trailing '&' indicating 'background processes' \fBprocesses\fP \- total number of processes running on the system; displayed in the lower bar in white text on a dark yellow background with a trailing '&' indicating 'background processes'