]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/controllers/perf_counters.py
1 # -*- coding: utf-8 -*-
2 from __future__
import absolute_import
7 from ..security
import Scope
8 from ..services
.ceph_service
import CephService
9 from . import ApiController
, ControllerDoc
, EndpointDoc
, RESTController
14 "description": (str, ""),
17 "priority": (int, ""),
25 class PerfCounter(RESTController
):
26 service_type
= None # type: str
28 def get(self
, service_id
):
30 return CephService
.get_service_perf_counters(self
.service_type
, str(service_id
))
31 except KeyError as error
:
32 raise cherrypy
.HTTPError(404, "{0} not found".format(error
))
35 @ApiController('perf_counters/mds', Scope
.CEPHFS
)
36 @ControllerDoc("Mds Perf Counters Management API", "MdsPerfCounter")
37 class MdsPerfCounter(PerfCounter
):
41 @ApiController('perf_counters/mon', Scope
.MONITOR
)
42 @ControllerDoc("Mon Perf Counters Management API", "MonPerfCounter")
43 class MonPerfCounter(PerfCounter
):
47 @ApiController('perf_counters/osd', Scope
.OSD
)
48 @ControllerDoc("OSD Perf Counters Management API", "OsdPerfCounter")
49 class OsdPerfCounter(PerfCounter
):
53 @ApiController('perf_counters/rgw', Scope
.RGW
)
54 @ControllerDoc("Rgw Perf Counters Management API", "RgwPerfCounter")
55 class RgwPerfCounter(PerfCounter
):
59 @ApiController('perf_counters/rbd-mirror', Scope
.RBD_MIRRORING
)
60 @ControllerDoc("Rgw Mirroring Perf Counters Management API", "RgwMirrorPerfCounter")
61 class RbdMirrorPerfCounter(PerfCounter
):
62 service_type
= 'rbd-mirror'
65 @ApiController('perf_counters/mgr', Scope
.MANAGER
)
66 @ControllerDoc("Mgr Perf Counters Management API", "MgrPerfCounter")
67 class MgrPerfCounter(PerfCounter
):
71 @ApiController('perf_counters/tcmu-runner', Scope
.ISCSI
)
72 @ControllerDoc("Tcmu Runner Perf Counters Management API", "TcmuRunnerPerfCounter")
73 class TcmuRunnerPerfCounter(PerfCounter
):
74 service_type
= 'tcmu-runner'
77 @ApiController('perf_counters')
78 @ControllerDoc("Perf Counters Management API", "PerfCounters")
79 class PerfCounters(RESTController
):
80 @EndpointDoc("Display Perf Counters",
81 responses
={200: PERF_SCHEMA
})
83 return mgr
.get_all_perf_counters()