diff --git a/debian/changelog b/debian/changelog index f2f86309..69815e43 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,16 @@ byobu (2.76) unreleased; urgency=low + [ Dustin Kirkland ] * usr/bin/byobu-select-session: default to -UDR, the "author's favorite" according to the screen(1) manpage; slightly more secure as it logs out other sessions; special handling is needed if the user wants to share sessions, LP: #578373; also, droping the -x should fix some resize problems, LP: #553085 + [ Jon Bernard ] + * ec2_cost, rcs_cost: calculate cost from the start of the + instance, rather than the uptime + -- Dustin Kirkland Sat, 15 May 2010 16:52:04 -0400 byobu (2.75-0ubuntu1) maverick; urgency=low diff --git a/usr/lib/byobu/ec2_cost b/usr/lib/byobu/ec2_cost index bc77aa65..75198e85 100755 --- a/usr/lib/byobu/ec2_cost +++ b/usr/lib/byobu/ec2_cost @@ -71,9 +71,7 @@ rx_gb=`echo "$ifconfig_out" | grep "RX bytes:" | sed "s/^.*RX bytes://" | awk '{ network_cost=`echo "$tx_gb" "$TX_RATE" "$rx_gb" "$RX_RATE" | awk '{printf "%f %f", $1*$2, $3*$4}' | awk '{printf "%f", $1 + $2}'` # Calculate uptime cost -# BUG: This will only calculate uptime since boot! -# Some additional input will be required to account for reboots!!! -hours=`awk '{printf "%f", 1 + $1 / 60 / 60 }' /proc/uptime | sed 's/\..*$//' ` +hours=$(((`date +%s` - `stat --printf %Z /etc/crontab`) / 60 / 60)) uptime_cost=`echo "$hours" | awk "{printf \"%f\", "$RATE" * $hours}"` total_cost=`echo "$network_cost" "$uptime_cost" | awk '{printf "%.2f", $1 + $2}'` diff --git a/usr/lib/byobu/rcs_cost b/usr/lib/byobu/rcs_cost index 219ec5b7..5a7c7184 100755 --- a/usr/lib/byobu/rcs_cost +++ b/usr/lib/byobu/rcs_cost @@ -74,9 +74,7 @@ rx_gb=`echo "$ifconfig_out" | grep "RX bytes:" | sed "s/^.*RX bytes://" | awk '{ network_cost=`echo "$tx_gb" "$TX_RATE" "$rx_gb" "$RX_RATE" | awk '{printf "%f %f", $1*$2, $3*$4}' | awk '{printf "%f", $1 + $2}'` # Calculate uptime cost -# BUG: This will only calculate uptime since boot! -# Some additional input will be required to account for reboots!!! -hours=`awk '{printf "%f", 1 + $1 / 60 / 60 }' /proc/uptime | sed 's/\..*$//' ` +hours=$(((`date +%s` - `stat --printf %Z /etc/crontab`) / 60 / 60)) uptime_cost=`echo "$hours" | awk "{printf \"%f\", "$MEMORY_RATE" * $hours}"` total_cost=`echo "$network_cost" "$uptime_cost" | awk '{printf "%.2f", $1 + $2}'`