<commit_before>import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Router, ActivatedRoute } from '@angular/router';
import { HoverflyService } from '../../shared/services/hoverfly.service';


@Component({
  selector: 'dashboard',
  templateUrl: 'dashboard.component.html',
  styleUrls: [
    'dashboard.component.css'
  ]
})
export class DashboardComponent {

  public version: string;
  public mode: string;
  public destination: string;
  public middlewareRemote: string;
  public middlewareBinary: string;
  public middlewareScript: string;
  public countersCaptured: number;
  public countersSimulated: number;
  public countersModified: number;
  public countersSynthesized: number;

  private hoverfly: HoverflyService;

  constructor(hoverflyService: HoverflyService) {
    this.hoverfly = hoverflyService;
    
    this.hoverfly.getVersion().subscribe(
      res => this.version = res
    );
    this.hoverfly.getMode().subscribe(
      res => this.mode = res
    );
    this.hoverfly.getDestination().subscribe(
      res => this.destination = res
    );
    this.hoverfly.getMiddleware().subscribe(
      res => {
        this.middlewareRemote = res.remote;
        this.middlewareBinary = res.binary;
        this.middlewareScript = res.script;
      });

    this.hoverfly.getUsageCounters().subscribe(
      res => {
        this.countersCaptured = res['usage']['counters']['capture'];
        this.countersSimulated = res['usage']['counters']['simulate'];
        this.countersModified = res['usage']['counters']['modify'];
        this.countersSynthesized = res['usage']['counters']['synthesize'];
      }
    );
  }<commit_msg>Fixing the counters<commit_after>import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Router, ActivatedRoute } from '@angular/router';
import { HoverflyService } from '../../shared/services/hoverfly.service';


@Component({
  selector: 'dashboard',
  templateUrl: 'dashboard.component.html',
  styleUrls: [
    'dashboard.component.css'
  ]
})
export class DashboardComponent {

  public version: string;
  public mode: string;
  public destination: string;
  public middlewareRemote: string;
  public middlewareBinary: string;
  public middlewareScript: string;
  public countersCaptured: number;
  public countersSimulated: number;
  public countersModified: number;
  public countersSynthesized: number;

  private hoverfly: HoverflyService;

  constructor(hoverflyService: HoverflyService) {
    this.hoverfly = hoverflyService;
    
    this.hoverfly.getVersion().subscribe(
      res => this.version = res
    );
    this.hoverfly.getMode().subscribe(
      res => this.mode = res
    );
    this.hoverfly.getDestination().subscribe(
      res => this.destination = res
    );
    this.hoverfly.getMiddleware().subscribe(
      res => {
        this.middlewareRemote = res.remote;
        this.middlewareBinary = res.binary;
        this.middlewareScript = res.script;
      });

    this.hoverfly.getUsageCounters().subscribe(
      res => {
        this.countersCaptured = res['capture'];
        this.countersSimulated = res['simulate'];
        this.countersModified = res['modify'];
        this.countersSynthesized = res['synthesize'];
      }
    );
  }
{'fraction_non_alphanumeric': 0.12545235223160434, 'fraction_numerical': 0.0, 'mean_word_length': 3.537619699042408, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5620586', 'n_tokens_mistral': 959, 'n_tokens_neox': 942, 'n_words': 192}