Skip to content

Commit 35b216f

Browse files
committed
[perfmon] Fix typo in variable name
Signed-off-by: Guillaume <guillaume.thouvenin@vates.tech>
1 parent 9f64a10 commit 35b216f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

python3/bin/perfmon

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -940,11 +940,11 @@ class SRMonitor(ObjectMonitor):
940940
num seconds this alarm disabled after an alarm is sent (default '3600')
941941
* consolidation_fn:
942942
how to combine variables from rrd_updates into one value
943-
(default is 'get_percent_sr_usage' for 'physical_utilistation',
943+
(default is 'get_percent_sr_usage' for 'physical_utilisation',
944944
& 'sum' for everything else)
945945
* rrd_regex matches the names of variables
946946
from (xe sr-data-sources-list uuid=$sruuid) used to compute value
947-
(has default for "physical_utilistaion")
947+
(has default for "physical_utilisation")
948948
"""
949949

950950
def __init__(self, *args):
@@ -975,7 +975,7 @@ class SRMonitor(ObjectMonitor):
975975
elif config_tag == "alarm_auto_inhibit_period":
976976
return "3600" # 1 hour
977977
elif config_tag == "alarm_trigger_level":
978-
if variable_name == "physical_utilistaion":
978+
if variable_name == "physical_utilisation":
979979
return "0.8" # trigger when 80% full
980980
else:
981981
raise XmlConfigException(

python3/tests/test_perfmon.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,14 @@ def test_process_rrd_updates(self, mock_xapisession):
427427
# get_percent_sr_usage([500, 6000])
428428
self.assertAlmostEqual(monitor.variables[0].value, 0.08333333333333333)
429429

430+
def test_alarm_trigger_level_physical_utilisation(self, _mock_xapisession):
431+
uuid = 'e1ae3f5d-4c8b-4575-bbb8-2af7e8a2c31e'
432+
monitor = perfmon.SRMonitor(uuid)
433+
result = monitor.get_default_variable_config(
434+
variable_name = "physical_utilisation",
435+
config_tag = "alarm_trigger_level",
436+
)
437+
self.assertEqual(result, '0.8')
430438

431439
class TestRRDUpdates(unittest.TestCase):
432440
'''Test Class RRDUpdates and RRDContentHandler'''

0 commit comments

Comments
 (0)