mirror of
https://github.com/ceph/ceph
synced 2024-12-27 05:53:20 +00:00
mgr: module to test osd_perf_query methods
Signed-off-by: Mykola Golub <mgolub@suse.com>
This commit is contained in:
parent
b18ddf4d37
commit
264ad39ff6
1
src/pybind/mgr/osd_perf_query/__init__.py
Normal file
1
src/pybind/mgr/osd_perf_query/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from .module import OSDPerfQuery
|
34
src/pybind/mgr/osd_perf_query/module.py
Normal file
34
src/pybind/mgr/osd_perf_query/module.py
Normal file
@ -0,0 +1,34 @@
|
||||
|
||||
"""
|
||||
osd_perf_query module
|
||||
"""
|
||||
|
||||
from mgr_module import MgrModule
|
||||
|
||||
|
||||
class OSDPerfQuery(MgrModule):
|
||||
COMMANDS = [
|
||||
{
|
||||
"cmd": "osd perf query add "
|
||||
"name=query,type=CephString,req=true",
|
||||
"desc": "add osd perf query",
|
||||
"perm": "w"
|
||||
},
|
||||
{
|
||||
"cmd": "osd perf query remove "
|
||||
"name=query_id,type=CephInt,req=true",
|
||||
"desc": "remove osd perf query",
|
||||
"perm": "w"
|
||||
},
|
||||
]
|
||||
|
||||
def handle_command(self, inbuf, cmd):
|
||||
if cmd['prefix'] == "osd perf query add":
|
||||
query_id = self.add_osd_perf_query(cmd['query'])
|
||||
return 0, str(query_id), "added query " + cmd['query'] + " with id " + str(query_id)
|
||||
elif cmd['prefix'] == "osd perf query remove":
|
||||
self.remove_osd_perf_query(cmd['query_id'])
|
||||
return 0, "", "removed query with id " + str(cmd['query_id'])
|
||||
else:
|
||||
raise NotImplementedError(cmd['prefix'])
|
||||
|
Loading…
Reference in New Issue
Block a user