]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/stats/module.py
2 performance stats for ceph filesystem (for now...)
6 from typing
import List
, Dict
8 from mgr_module
import MgrModule
, Option
10 from .fs
.perf_stats
import FSPerfStats
12 class Module(MgrModule
):
15 "cmd": "fs perf stats "
16 "name=mds_rank,type=CephString,req=false "
17 "name=client_id,type=CephString,req=false "
18 "name=client_ip,type=CephString,req=false ",
19 "desc": "retrieve ceph fs performance stats",
23 MODULE_OPTIONS
: List
[Option
] = []
25 def __init__(self
, *args
, **kwargs
):
26 super(Module
, self
).__init
__(*args
, **kwargs
)
27 self
.fs_perf_stats
= FSPerfStats(self
)
29 def notify(self
, notify_type
, notify_id
):
30 if notify_type
== "command":
31 self
.fs_perf_stats
.notify(notify_id
)
33 def handle_command(self
, inbuf
, cmd
):
34 prefix
= cmd
['prefix']
35 # only supported command is `fs perf stats` right now
36 if prefix
.startswith('fs perf stats'):
37 return self
.fs_perf_stats
.get_perf_data(cmd
)
38 raise NotImplementedError(cmd
['prefix'])