From c1455f47e5cdcd8a8bdccc4962c62ff7eff04439 Mon Sep 17 00:00:00 2001 From: Nate Coraor Date: Tue, 12 Dec 2023 16:45:40 -0500 Subject: [PATCH] Separate cgroup metrics default params from titles --- .../job_metrics/instrumenters/cgroup.py | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/job_metrics/instrumenters/cgroup.py b/lib/galaxy/job_metrics/instrumenters/cgroup.py index 7f0a3b9b2493..dc06b8d6cbcf 100644 --- a/lib/galaxy/job_metrics/instrumenters/cgroup.py +++ b/lib/galaxy/job_metrics/instrumenters/cgroup.py @@ -19,6 +19,24 @@ log = logging.getLogger(__name__) VALID_VERSIONS = ("auto", "1", "2") +DEFAULT_PARAMS = ( + # cgroupsv1 - probably more than useful but don't remove any for legacy reasons + "memory.memsw.max_usage_in_bytes", + "memory.max_usage_in_bytes", + "memory.limit_in_bytes", + "memory.memsw.limit_in_bytes", + "memory.soft_limit_in_bytes", + "memory.failcnt", + "memory.oom_control.oom_kill_disable", + "memory.oom_control.under_oom", + "cpuacct.usage", + # cgroupsv2 + "memory.events.oom_kill", + "memory.peak", + "cpu.stat.system_usec", + "cpu.stat.usage_usec", + "cpu.stat.user_usec", +) TITLES = { # cgroupsv1 "memory.memsw.max_usage_in_bytes": "Max memory usage (MEM+SWP)", @@ -44,9 +62,9 @@ "memory.max": "Memory usage hard limit", "memory.min": "Hard memory protection", "memory.peak": "Max memory usage recorded", - "cpu.stat.system_usec": "CPU system time (seconds)", - "cpu.stat.usage_usec": "CPU usage time (seconds)", - "cpu.stat.user_usec": "CPU user time (seconds)", + "cpu.stat.system_usec": "CPU system time", + "cpu.stat.usage_usec": "CPU usage time", + "cpu.stat.user_usec": "CPU user time", } CONVERSION = { "memory.oom_control.oom_kill_disable": lambda x: "No" if x == 1 else "Yes", @@ -124,7 +142,7 @@ def __init__(self, **kwargs): if params_str: params = [v.strip() for v in params_str.split(",")] else: - params = list(TITLES.keys()) + params = DEFAULT_PARAMS self.params = params def post_execute_instrument(self, job_directory: str) -> List[str]: