]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/performance-counter.service.ts
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / api / performance-counter.service.ts
1 import { HttpClient } from '@angular/common/http';
2 import { Injectable } from '@angular/core';
3
4 import { of as observableOf } from 'rxjs';
5 import { mergeMap } from 'rxjs/operators';
6
7 import { cdEncode } from '../decorators/cd-encode';
8
9 @cdEncode
10 @Injectable({
11 providedIn: 'root'
12 })
13 export class PerformanceCounterService {
14 private url = 'api/perf_counters';
15
16 constructor(private http: HttpClient) {}
17
18 list() {
19 return this.http.get(this.url);
20 }
21
22 get(service_type: string, service_id: string) {
23 return this.http.get(`${this.url}/${service_type}/${service_id}`).pipe(
24 mergeMap((resp: any) => {
25 return observableOf(resp['counters']);
26 })
27 );
28 }
29 }