1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Feature #1099: Fix oneacct column measure units

This commit is contained in:
Carlos Martín 2012-05-11 15:30:53 +02:00
parent efba395aef
commit fe67d12209

View File

@ -90,7 +90,7 @@ class AcctHelper
end
column :MEMORY, "Assigned memory", :right, :size=>6 do |d|
OpenNebulaHelper.unit_to_str(d["VM/TEMPLATE/MEMORY"].to_i, {})
OpenNebulaHelper.unit_to_str(d["VM/TEMPLATE/MEMORY"].to_i, {}, 'M')
end
column :CPU, "Number of CPUs", :right, :size=>3 do |d|
@ -98,11 +98,13 @@ class AcctHelper
end
column :NET_RX, "Data received from the network", :right, :size=>6 do |d|
OpenNebulaHelper.unit_to_str(d["VM/NET_RX"].to_i, {})
# NET is measured in bytes, unit_to_str expects KBytes
OpenNebulaHelper.unit_to_str(d["VM/NET_RX"].to_i / 1024.0, {})
end
column :NET_TX, "Data sent to the network", :right, :size=>6 do |d|
OpenNebulaHelper.unit_to_str(d["VM/NET_TX"].to_i, {})
# NET is measured in bytes, unit_to_str expects KBytes
OpenNebulaHelper.unit_to_str(d["VM/NET_TX"].to_i / 1024.0, {})
end
default :VID, :HOSTNAME, :REASON, :START_TIME, :END_TIME, :MEMORY, :CPU, :NET_RX, :NET_TX