1 import { Component, Input, OnInit, TemplateRef, ViewChild } from '@angular/core';
4 PerformanceCounterService
5 } from '../../../shared/api/performance-counter.service';
6 import { CdTableColumn } from '../../../shared/models/cd-table-column';
9 * Display the specified performance counters in a datatable.
12 selector: 'cd-table-performance-counter',
13 templateUrl: './table-performance-counter.component.html',
14 styleUrls: ['./table-performance-counter.component.scss']
16 export class TablePerformanceCounterComponent implements OnInit {
18 columns: Array<CdTableColumn> = [];
19 counters: Array<object> = [];
21 @ViewChild('valueTpl') public valueTpl: TemplateRef<any>;
24 * The service type, e.g. 'rgw', 'mds', 'mon', 'osd', ...
26 @Input() serviceType: string;
29 * The service identifier.
31 @Input() serviceId: string;
33 constructor(private performanceCounterService: PerformanceCounterService) { }
49 cellTemplate: this.valueTpl,
56 this.performanceCounterService.get(this.serviceType, this.serviceId)
57 .subscribe((resp: object[]) => {