# All files / src/app/ceph/performance-counter/performance-counter performance-counter.component.ts

100% Statements 14/14
80% Branches 4/5
100% Functions 3/3
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    2610x
    10x

    10x
    10x

    1x
    1x
    1x

    1x
    1x
    1x

    10x
     import { Component } from '@angular/core';
    import { ActivatedRoute } from '@angular/router';

    @Component({
      selector: 'cd-performance-counter',
      template: require('./performance-counter.component.html'),
      styles: []
    })
    export class PerformanceCounterComponent {
      static defaultFromLink = '/hosts';

      serviceId: string;
      serviceType: string;
      fromLink: string;

      constructor(private route: ActivatedRoute) {
        this.route.queryParams.subscribe((params: { fromLink: string }) => {
          this.fromLink = params.fromLink || PerformanceCounterComponent.defaultFromLink;
        });
        this.route.params.subscribe((params: { type: string; id: string }) => {
          this.serviceId = params.id;
          this.serviceType = params.type;
        });
      }
    }