From 4298941471eb35605dbe002f8e33b26617f02586 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Sat, 18 Feb 2023 13:36:39 +0000 Subject: T5013: accelppp replace cpu key to cpu_load_percentage op-mode Change op-mode raw statistics for accel_ppp.py dict key 'cpu' to 'cpu_load_percentage' and value to integer --- python/vyos/accel_ppp.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'python') diff --git a/python/vyos/accel_ppp.py b/python/vyos/accel_ppp.py index bfc8ee5a9..0af311e57 100644 --- a/python/vyos/accel_ppp.py +++ b/python/vyos/accel_ppp.py @@ -38,6 +38,9 @@ def get_server_statistics(accel_statistics, pattern, sep=':') -> dict: if key in ['starting', 'active', 'finishing']: stat_dict['sessions'][key] = value.strip() continue + if key == 'cpu': + stat_dict['cpu_load_percentage'] = int(re.sub(r'%', '', value.strip())) + continue stat_dict[key] = value.strip() return stat_dict -- cgit v1.2.3