]>
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
, NotifyType
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
] = []
24 NOTIFY_TYPES
= [NotifyType
.command
, NotifyType
.fs_map
]
26 def __init__(self
, *args
, **kwargs
):
27 super(Module
, self
).__init
__(*args
, **kwargs
)
28 self
.fs_perf_stats
= FSPerfStats(self
)
30 def notify(self
, notify_type
: NotifyType
, notify_id
):
31 if notify_type
== NotifyType
.command
:
32 self
.fs_perf_stats
.notify_cmd(notify_id
)
33 elif notify_type
== NotifyType
.fs_map
:
34 self
.fs_perf_stats
.notify_fsmap()
36 def handle_command(self
, inbuf
, cmd
):
37 prefix
= cmd
['prefix']
38 # only supported command is `fs perf stats` right now
39 if prefix
.startswith('fs perf stats'):
40 return self
.fs_perf_stats
.get_perf_data(cmd
)
41 raise NotImplementedError(cmd
['prefix'])