mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
feature #720: Use cpu_usage instead of cpu for VM probes
This commit is contained in:
parent
4ca488c630
commit
cf53b7d0eb
@ -35,11 +35,11 @@ module WatchHelper
|
||||
}
|
||||
|
||||
VM_SAMPLE = {
|
||||
:cpu => {
|
||||
:cpu_usage => {
|
||||
:type => Integer,
|
||||
:path => 'CPU'
|
||||
},
|
||||
:memory => {
|
||||
:mem_usage => {
|
||||
:type => Integer,
|
||||
:path => 'MEMORY'
|
||||
},
|
||||
@ -200,28 +200,12 @@ module WatchHelper
|
||||
unrestrict_primary_key
|
||||
|
||||
many_to_one :vm
|
||||
|
||||
def self.active
|
||||
self.filter(:state=>3)
|
||||
end
|
||||
|
||||
def self.error
|
||||
self.filter(:state=>7)
|
||||
end
|
||||
end
|
||||
|
||||
class HostSample < Sequel::Model
|
||||
unrestrict_primary_key
|
||||
|
||||
many_to_one :host
|
||||
|
||||
def self.active
|
||||
self.filter('state < 3')
|
||||
end
|
||||
|
||||
def self.error
|
||||
self.filter(:state=>3)
|
||||
end
|
||||
end
|
||||
|
||||
class Register < Sequel::Model
|
||||
@ -274,9 +258,9 @@ module WatchHelper
|
||||
v.name = vm['NAME']
|
||||
v.uid = vm['UID'].to_i
|
||||
v.gid = vm['GID'].to_i
|
||||
v.mem = vm['MEMORY'].to_i
|
||||
v.cpu = vm['CPU'].to_i
|
||||
v.vcpu = vm['VCPU'].to_i
|
||||
v.mem = vm['TEMPLATE/MEMORY'].to_i
|
||||
v.cpu = vm['TEMPLATE/CPU'].to_i
|
||||
v.vcpu = vm['TEMPLATE/VCPU'].to_i
|
||||
v.stime = vm['STIME'].to_i
|
||||
v.etime = vm['ETIME'].to_i
|
||||
}
|
||||
|
@ -25,13 +25,13 @@ var graph1 = {
|
||||
|
||||
var graph2 = {
|
||||
title : "graph2",
|
||||
monitor_resources : "cpu",
|
||||
monitor_resources : "cpu_usage",
|
||||
history_length : HISTORY_LENGTH
|
||||
};
|
||||
|
||||
var graph3 = {
|
||||
title : "graph3",
|
||||
monitor_resources : "memory",
|
||||
monitor_resources : "mem_usage",
|
||||
history_length : HISTORY_LENGTH
|
||||
};
|
||||
|
||||
|
@ -26,12 +26,12 @@ loadVNC();
|
||||
|
||||
var vm_graphs = [
|
||||
{ title : "CPU",
|
||||
monitor_resources : "cpu",
|
||||
monitor_resources : "cpu_usage",
|
||||
humanize_figures : false,
|
||||
history_length : VM_HISTORY_LENGTH
|
||||
},
|
||||
{ title : "Memory",
|
||||
monitor_resources : "memory",
|
||||
monitor_resources : "mem_usage",
|
||||
humanize_figures : true,
|
||||
history_length : VM_HISTORY_LENGTH
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user