mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
rather than instance instantiation; use /etc/hostname instead; ensure
This commit is contained in:
parent
4381d2f519
commit
9063cf1622
3 changed files with 3 additions and 5 deletions
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -6,7 +6,7 @@ byobu (3.5) unreleased; urgency=low
|
|||
[ 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
|
||||
rather than instance instantiation; use /etc/hostname instead; ensure
|
||||
that minimum hours is 1, not 0
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 01 Sep 2010 13:11:34 -0600
|
||||
|
|
|
@ -74,8 +74,7 @@ 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 /var/lib`) / 60 / 60))
|
||||
[ "$hours" = "0" ] && hours=1
|
||||
hours=$(((`date +%s` - `stat --printf %Z /etc/hostname`) / 60 / 60 + 1))
|
||||
uptime_cost=`echo "$hours" | awk "{printf \"%f\", "$RATE" * $hours}"`
|
||||
total_cost=`echo "$network_cost" "$uptime_cost" | awk '{printf "%.2f", $1 + $2}'`
|
||||
|
||||
|
|
|
@ -76,8 +76,7 @@ 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 /var/lib`) / 60 / 60))
|
||||
[ "$hours" = "0" ] && hours=1
|
||||
hours=$(((`date +%s` - `stat --printf %Z /etc/hostname`) / 60 / 60 + 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