]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr: Add per-module performance counters to mgr
authorNitzan Mordechai <nmordech@redhat.com>
Sun, 8 Dec 2024 18:08:39 +0000 (18:08 +0000)
committerNitzan Mordechai <nmordech@ibm.com>
Mon, 25 May 2026 07:48:06 +0000 (07:48 +0000)
commit95a90f7da8a32dd2a5a1e3b381aaeacea378437b
treed5d89407b5e218e0993dd0c7069c7e03520d6c61
parentdfbdc5dd165016a6f5c12c165236f8304ac24dbd
mgr: Add per-module performance counters to mgr

This commit introduces performance counters for individual Ceph mgr modules.
These counters allow monitoring module behavior, debugging latency issues,
and identifying performance bottlenecks, all without modifying the modules themselves.

The following counters are now exposed under:
  > ceph daemon mgr.<id> perf dump

Example structure:
"mgr_module_<module_name>": {
    "notify_avg_usec": {     <- Average time spent handling notify events
        "avgcount": 0,
        "sum": 0
    },
    "cmd_avg_usec": {        <- Average time spent processing CLI/admin commands
        "avgcount": 0,
        "sum": 0
    },
    "serve_avg_usec": {      <- Average time spent in module serve loop (if applicable)
        "avgcount": 0,
        "sum": 0
    },
    "alive": 1               <- Module is alive (1 = running, 0 = exited)
    "cpu_usage": 0,          <- CPU usage in percent
    "mem_rss_change": 0,     <- Memory RSS change in bytes
    "mem_rss_current": 490737664 <- Memory RSS current in bytes

}

Signed-off-by: Nitzan Mordechai <nmordech@ibm.com>
Conflicts:
  src/mgr/ActivePyModules.cc - finisher.queue changed by 63859, adding py_module to the parameter list
  src/mgr/PyModuleRegistry.cc - check_all_modules_started added by 63859
17 files changed:
doc/mgr/administrator.rst
src/common/Finisher.cc
src/common/Finisher.h
src/common/options/mgr.yaml.in
src/mgr/ActivePyModule.cc
src/mgr/ActivePyModule.h
src/mgr/ActivePyModules.cc
src/mgr/ActivePyModules.h
src/mgr/CMakeLists.txt
src/mgr/PyModule.cc
src/mgr/PyModule.h
src/mgr/PyModuleRegistry.cc
src/mgr/PyModuleRegistry.h
src/mgr/PyModuleRunner.cc
src/mgr/PyModuleRunner.h
src/mgr/ThreadMonitor.cc [new file with mode: 0644]
src/mgr/ThreadMonitor.h [new file with mode: 0644]