mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
[ Jan Klepek ]
[ Dustin Kirkland ] usr/lib/byobu/rcs_cost, usr/lib/byobu/ec2_cost: testing crontab creation time is not accurate, seems this happens at image creation rather than instance instantiation; use /var/lib instead; ensure that minimum hours is 1, not 0
This commit is contained in:
parent
b3913a3521
commit
4381d2f519
3 changed files with 11 additions and 2 deletions
7
debian/changelog
vendored
7
debian/changelog
vendored
|
@ -1,7 +1,14 @@
|
|||
byobu (3.5) unreleased; urgency=low
|
||||
|
||||
[ Jan Klepek ]
|
||||
* usr/bin/byobu-status: fix libexec path for Fedora, LP: #630054
|
||||
|
||||
[ Dustin Kirkland ]
|
||||
* usr/lib/byobu/rcs_cost, usr/lib/byobu/ec2_cost: testing crontab
|
||||
creation time is not accurate, seems this happens at image creation
|
||||
rather than instance instantiation; use /var/lib instead; ensure
|
||||
that minimum hours is 1, not 0
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 01 Sep 2010 13:11:34 -0600
|
||||
|
||||
byobu (3.4-0ubuntu1) maverick; urgency=low
|
||||
|
|
|
@ -74,7 +74,8 @@ rx_gb=$(echo ${rx_gb%% *} | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }')
|
|||
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
|
||||
hours=$(((`date +%s` - `stat --printf %Z /etc/crontab`) / 60 / 60))
|
||||
hours=$(((`date +%s` - `stat --printf %Z /var/lib`) / 60 / 60))
|
||||
[ "$hours" = "0" ] && hours=1
|
||||
uptime_cost=`echo "$hours" | awk "{printf \"%f\", "$RATE" * $hours}"`
|
||||
total_cost=`echo "$network_cost" "$uptime_cost" | awk '{printf "%.2f", $1 + $2}'`
|
||||
|
||||
|
|
|
@ -76,7 +76,8 @@ rx_gb=$(echo ${rx_gb%% *} | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }')
|
|||
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
|
||||
hours=$(((`date +%s` - `stat --printf %Z /etc/crontab`) / 60 / 60))
|
||||
hours=$(((`date +%s` - `stat --printf %Z /var/lib`) / 60 / 60))
|
||||
[ "$hours" = "0" ] && hours=1
|
||||
uptime_cost=`echo "$hours" | awk "{printf \"%f\", "$MEMORY_RATE" * $hours}"`
|
||||
total_cost=`echo "$network_cost" "$uptime_cost" | awk '{printf "%.2f", $1 + $2}'`
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue