]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/controllers/perf_counters.py
ab0bdcb0b32b939d5fa997b3fdd5f25bd4a5059c
1 # -*- coding: utf-8 -*-
6 from ..security
import Scope
7 from ..services
.ceph_service
import CephService
8 from . import APIDoc
, APIRouter
, EndpointDoc
, RESTController
13 "description": (str, ""),
16 "priority": (int, ""),
24 class PerfCounter(RESTController
):
25 service_type
= None # type: str
27 def get(self
, service_id
):
29 return CephService
.get_service_perf_counters(self
.service_type
, str(service_id
))
30 except KeyError as error
:
31 raise cherrypy
.HTTPError(404, "{0} not found".format(error
))
34 @APIRouter('perf_counters/mds', Scope
.CEPHFS
)
35 @APIDoc("Mds Perf Counters Management API", "MdsPerfCounter")
36 class MdsPerfCounter(PerfCounter
):
40 @APIRouter('perf_counters/mon', Scope
.MONITOR
)
41 @APIDoc("Mon Perf Counters Management API", "MonPerfCounter")
42 class MonPerfCounter(PerfCounter
):
46 @APIRouter('perf_counters/osd', Scope
.OSD
)
47 @APIDoc("OSD Perf Counters Management API", "OsdPerfCounter")
48 class OsdPerfCounter(PerfCounter
):
52 @APIRouter('perf_counters/rgw', Scope
.RGW
)
53 @APIDoc("Rgw Perf Counters Management API", "RgwPerfCounter")
54 class RgwPerfCounter(PerfCounter
):
58 @APIRouter('perf_counters/rbd-mirror', Scope
.RBD_MIRRORING
)
59 @APIDoc("Rgw Mirroring Perf Counters Management API", "RgwMirrorPerfCounter")
60 class RbdMirrorPerfCounter(PerfCounter
):
61 service_type
= 'rbd-mirror'
64 @APIRouter('perf_counters/mgr', Scope
.MANAGER
)
65 @APIDoc("Mgr Perf Counters Management API", "MgrPerfCounter")
66 class MgrPerfCounter(PerfCounter
):
70 @APIRouter('perf_counters/tcmu-runner', Scope
.ISCSI
)
71 @APIDoc("Tcmu Runner Perf Counters Management API", "TcmuRunnerPerfCounter")
72 class TcmuRunnerPerfCounter(PerfCounter
):
73 service_type
= 'tcmu-runner'
76 @APIRouter('perf_counters')
77 @APIDoc("Perf Counters Management API", "PerfCounters")
78 class PerfCounters(RESTController
):
79 @EndpointDoc("Display Perf Counters",
80 responses
={200: PERF_SCHEMA
})
82 return mgr
.get_unlabeled_perf_counters()