mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-01 05:47:01 +03:00
(cherry picked from commit eecbfe351ca4f995a45b0e55fe61cb148a7f3aa6)
This commit is contained in:
parent
2efd46f163
commit
9cb1bbde27
@ -30,7 +30,7 @@ using namespace std;
|
||||
|
||||
int CapacityMonitoring::from_template(const Template &tmpl)
|
||||
{
|
||||
int value;
|
||||
unsigned long value;
|
||||
if (tmpl.get("FREECPU", value))
|
||||
{
|
||||
add("FREE_CPU", value);
|
||||
@ -55,7 +55,7 @@ int CapacityMonitoring::from_template(const Template &tmpl)
|
||||
|
||||
int SystemMonitoring::from_template(const Template &tmpl)
|
||||
{
|
||||
int value;
|
||||
unsigned long value;
|
||||
if (tmpl.get("CPUSPEED", value))
|
||||
{
|
||||
add("CPU_SPEED", value);
|
||||
|
@ -48,8 +48,8 @@ def system(cpu, mem)
|
||||
FREEMEMORY=#{16777216-used_memory}
|
||||
USEDCPU=#{used_cpu}
|
||||
FREECPU=#{800-used_cpu}
|
||||
NETTX=0
|
||||
NETRX=0
|
||||
NETTX=1241307203246698
|
||||
NETRX=50104108822222
|
||||
EOS
|
||||
end
|
||||
|
||||
|
@ -87,14 +87,14 @@ vmpool.each do |vm|
|
||||
base_net = Time.now.to_i % 10000
|
||||
|
||||
mon_s = unindent(<<-EOS)
|
||||
NETTX=#{base_net + (rand(3) * 50)}
|
||||
NETRX=#{base_net + (rand(4) * 100)}
|
||||
NETTX=#{base_net + (rand(1..3) * 50)}
|
||||
NETRX=#{base_net + (rand(1..4) * 100)}
|
||||
MEMORY=#{max_memory * rand(20..100)/100}
|
||||
CPU=#{max_cpu * rand(5..100)/100}
|
||||
DISKRDBYTES=#{rand(1000)}
|
||||
DISKWRBYTES=#{rand(1000)}
|
||||
DISKRDIOPS=#{rand(1000)}
|
||||
DISKWRIOPS=#{rand(1000)}
|
||||
DISKRDBYTES=#{rand(1..1000)}
|
||||
DISKWRBYTES=#{rand(1..1000)}
|
||||
DISKRDIOPS=#{rand(1..1000)}
|
||||
DISKWRIOPS=#{rand(1..1000)}
|
||||
EOS
|
||||
|
||||
mon_s64 = Base64.strict_encode64(mon_s)
|
||||
|
Loading…
x
Reference in New Issue
Block a user