1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-23 21:57:43 +03:00

feature #1098: Support for group accounting. Revert resource naming

This commit is contained in:
Ruben S. Montero 2012-08-29 14:38:40 +02:00
parent ac5a551989
commit 4da2095529
3 changed files with 17 additions and 6 deletions

View File

@ -305,7 +305,15 @@ class SunstoneServer < CloudServer
tstart = options[:start].to_i
tend = options[:end].to_i
interval = options[:interval].to_i
meters = options[:acct_resources]
meters = options[:monitor_resources]
gid = options[:gid]
acct_options = {:start_time => tstart,
:end_time => tend}
if gid
uid = INFO_ALL
acct_options[:group] = gid
end
result = {}
meters_a = meters.split(',')
@ -313,9 +321,7 @@ class SunstoneServer < CloudServer
result[meter] = []
end
pool = VirtualMachinePool.new(@client)
acct_xml = pool.accounting_xml(uid,
:start_time => tstart,
:end_time => tend)
acct_xml = pool.accounting_xml(uid, acct_options)
if OpenNebula.is_error?(acct_xml)
error = Error.new(acct_xml.message)

View File

@ -23,11 +23,11 @@ var $update_pw_dialog;
var user_acct_graphs = [
{ title : tr("CPU"),
acct_resources : "CPU",
monitor_resources : "CPU",
humanize_figures : false
},
{ title : tr("Memory"),
acct_resources : "MEMORY",
monitor_resources : "MEMORY",
humanize_figures : true
}
];

View File

@ -322,6 +322,11 @@ get '/user/:id/monitor' do
@SunstoneServer.get_user_accounting(params)
end
get '/group/:id/monitor' do
params[:gid] = params[:id]
@SunstoneServer.get_user_accounting(params)
end
get '/:resource/:id/monitor' do
@SunstoneServer.get_resource_monitoring(
params[:id],