]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix tcmu-runner perf counters page 28154/head
authorRicardo Marques <rimarques@suse.com>
Thu, 16 May 2019 15:48:39 +0000 (16:48 +0100)
committerRicardo Marques <rimarques@suse.com>
Thu, 16 May 2019 16:04:01 +0000 (17:04 +0100)
Fixes: https://tracker.ceph.com/issues/39954
Signed-off-by: Ricardo Marques <rimarques@suse.com>
src/pybind/mgr/dashboard/controllers/perf_counters.py
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter/performance-counter.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/performance-counter.service.ts
src/pybind/mgr/mgr_module.py

index bfe495619ccfabec83c1676a9f87e4a574180e48..158641ca1562f2dca7830e09e627a7df54760bb4 100644 (file)
@@ -74,6 +74,11 @@ class MgrPerfCounter(PerfCounter):
     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):
index 61c74f476803220e89f670089bc15b9e29b7fb2f..fa107253fd7a14e27bfccea59b623c7b4660e88a 100644 (file)
@@ -80,7 +80,7 @@ export class HostsComponent implements OnInit {
       .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;
index e6eaf5db4100c4af687514484e1eb2461a7d7f03..9321e0e9aae86d82426d5cc195e50b05f446bd60 100644 (file)
@@ -18,7 +18,7 @@ export class PerformanceCounterComponent {
       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;
     });
   }
index 6cd54dfdad1b2288aa63c0e52ce9787b67a255d8..5cf4207a05baba545ab16417fe92ff0aca14fea4 100644 (file)
@@ -4,8 +4,10 @@ import { Injectable } from '@angular/core';
 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
 })
@@ -19,8 +21,7 @@ export class PerformanceCounterService {
   }
 
   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']);
       })
index 1fda163ba38514bf6f50093491bf38fe2559d04c..854f7c871d3139cdc20ed4c0fec845d8ffbb6d30 100644 (file)
@@ -1098,7 +1098,7 @@ class MgrModule(ceph_module.BaseMgrModule):
 
     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`.