1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-01 05:47:01 +03:00

B #6114: Fix NETTX and NETRX host monitoring (#2494)

(cherry picked from commit eecbfe351ca4f995a45b0e55fe61cb148a7f3aa6)
This commit is contained in:
Pavel Czerný 2023-02-13 17:33:02 +01:00 committed by Ruben S. Montero
parent 2efd46f163
commit 9cb1bbde27
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
3 changed files with 10 additions and 10 deletions

View File

@ -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);

View File

@ -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

View File

@ -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)