service_type = 'mgr'
+@ApiController('perf_counters/tcmu-runner', Scope.ISCSI)
+class TcmuRunnerPerfCounter(PerfCounter):
+ service_type = 'tcmu-runner'
+
+
@ApiController('perf_counters')
class PerfCounters(RESTController):
def list(self):
.then((resp) => {
resp.map((host) => {
host.services.map((service) => {
- service.cdLink = `/perf_counters/${service.type}/${service.id}`;
+ service.cdLink = `/perf_counters/${service.type}/${encodeURIComponent(service.id)}`;
const permission = this.permissions[typeToPermissionKey[service.type]];
service.canRead = permission ? permission.read : false;
return service;
this.fromLink = params.fromLink || PerformanceCounterComponent.defaultFromLink;
});
this.route.params.subscribe((params: { type: string; id: string }) => {
- this.serviceId = params.id;
+ this.serviceId = decodeURIComponent(params.id);
this.serviceType = params.type;
});
}
import { of as observableOf } from 'rxjs';
import { mergeMap } from 'rxjs/operators';
+import { cdEncode } from '../decorators/cd-encode';
import { ApiModule } from './api.module';
+@cdEncode
@Injectable({
providedIn: ApiModule
})
}
get(service_type: string, service_id: string) {
- const serviceType = service_type.replace('-', '_');
- return this.http.get(`${this.url}/${serviceType}/${service_id}`).pipe(
+ return this.http.get(`${this.url}/${service_type}/${service_id}`).pipe(
mergeMap((resp) => {
return observableOf(resp['counters']);
})
def get_all_perf_counters(self, prio_limit=PRIO_USEFUL,
services=("mds", "mon", "osd",
- "rbd-mirror", "rgw")):
+ "rbd-mirror", "rgw", "tcmu-runner")):
"""
Return the perf counters currently known to this ceph-mgr
instance, filtered by priority equal to or greater than `prio_limit`.