Added host_cpu_overload_threshold to the state
This commit is contained in:
parent
11aa36ca19
commit
0268de7528
@ -167,6 +167,8 @@ def init_state(config):
|
||||
'previous_overload': -1,
|
||||
'vir_connection': vir_connection,
|
||||
'hostname': hostname,
|
||||
'host_cpu_overload_threshold':
|
||||
float(config['host_cpu_overload_threshold']),
|
||||
'physical_cpus': physical_cpus,
|
||||
'physical_cpu_mhz': host_cpu_mhz,
|
||||
'physical_core_mhz': host_cpu_mhz / physical_cpus,
|
||||
@ -261,7 +263,7 @@ def execute(config, state):
|
||||
|
||||
state['previous_overload'] = log_host_overload(
|
||||
state['db'],
|
||||
config['host_cpu_overload_threshold'],
|
||||
state['host_cpu_overload_threshold'],
|
||||
state['hostname'],
|
||||
state['previous_overload'],
|
||||
state['physical_cpu_mhz'],
|
||||
|
@ -61,7 +61,8 @@ class Collector(TestCase):
|
||||
physical_cpus = 13
|
||||
expect(common).physical_cpu_count(vir_connection). \
|
||||
and_return(physical_cpus).once()
|
||||
config = {'sql_connection': 'db'}
|
||||
config = {'sql_connection': 'db',
|
||||
'host_cpu_overload_threshold': '0.95'}
|
||||
|
||||
hostname = 'host1'
|
||||
mhz = 13540
|
||||
@ -80,6 +81,7 @@ class Collector(TestCase):
|
||||
assert isinstance(state['previous_cpu_time'], dict)
|
||||
assert state['vir_connection'] == vir_connection
|
||||
assert state['hostname'] == hostname
|
||||
assert state['host_cpu_overload_threshold'] == 0.95
|
||||
assert state['physical_cpus'] == physical_cpus
|
||||
assert state['physical_cpu_mhz'] == mhz
|
||||
assert state['physical_core_mhz'] == mhz / physical_cpus
|
||||
|
Loading…
x
Reference in New Issue
Block a user