From afffba457f5b8ac8a4b1031818b031f81d8d1841 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 2 Nov 2026 14:12:30 +0000 Subject: [PATCH] Clean up proc comment --- synapse/metrics/_thread_cpu.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/synapse/metrics/_thread_cpu.py b/synapse/metrics/_thread_cpu.py index 16069854dc..365a49e128 100644 --- a/synapse/metrics/_thread_cpu.py +++ b/synapse/metrics/_thread_cpu.py @@ -157,7 +157,13 @@ class ThreadCPUMetrics(Collector): continue # The thread name may contain spaces or brackets, so split after - # its closing bracket. See `man 5 proc` for the field numbers. + # its closing bracket. See `man 5 proc_pid_stat` for the field + # numbers (note they're off by three due to zero-based indexing + # and we have split off the first two fields). + # + # Example of the start of such a line: + # + # 171453 (cat) R 30798 171453 ... fields = line.rsplit(")", 1)[1].split() utime = int(fields[11]) stime = int(fields[12])