<commit_before>import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';

export declare interface Environment {
  readonly environmentId: string;
  readonly name: string;
}

export declare interface Stat {
  readonly used: number;
  readonly total: number;
}

export declare interface MemoryStat extends Stat {}

export declare interface CpuStat extends Stat {}

@Injectable()
export class AppsService {

  private static readonly POLL_RATE_MS: number = 5000;

  getApplications(spaceId: string): Observable<string[]> {
    return Observable.of(['vertx-hello', 'vertx-paint', 'vertx-wiki']);
  }

  getEnvironments(spaceId: string): Observable<string[]> {
    return Observable.of(['stage', 'run']);
  }

  getPodCount(spaceId: string, environmentId: string): Observable<number> {
    return Observable
      .interval(AppsService.POLL_RATE_MS)
      .map(() => Math.floor(Math.random() * 5) + 1);
  }

  getCpuStat(spaceId: string, environmentId: string): Observable<CpuStat> {
    return Observable
      .interval(AppsService.POLL_RATE_MS)
      .map(() => ({ used: Math.floor(Math.random() * 9) + 1, total: 10 } as CpuStat));
  }

  getMemoryStat(spaceId: string, environmentId: string): Observable<MemoryStat> {
    return Observable
      .interval(AppsService.POLL_RATE_MS)
      .map(() => ({ used: Math.floor(Math.random() * 156) + 100, total: 256 } as MemoryStat));
  }
}<commit_msg>Add distinctUntilChanged operator<commit_after>import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';

export declare interface Environment {
  readonly environmentId: string;
  readonly name: string;
}

export declare interface Stat {
  readonly used: number;
  readonly total: number;
}

export declare interface MemoryStat extends Stat {}

export declare interface CpuStat extends Stat {}

@Injectable()
export class AppsService {

  private static readonly POLL_RATE_MS: number = 5000;

  getApplications(spaceId: string): Observable<string[]> {
    return Observable.of(['vertx-hello', 'vertx-paint', 'vertx-wiki']);
  }

  getEnvironments(spaceId: string): Observable<string[]> {
    return Observable.of(['stage', 'run']);
  }

  getPodCount(spaceId: string, environmentId: string): Observable<number> {
    return Observable
      .interval(AppsService.POLL_RATE_MS)
      .distinctUntilChanged()
      .map(() => Math.floor(Math.random() * 5) + 1);
  }

  getCpuStat(spaceId: string, environmentId: string): Observable<CpuStat> {
    return Observable
      .interval(AppsService.POLL_RATE_MS)
      .distinctUntilChanged()
      .map(() => ({ used: Math.floor(Math.random() * 9) + 1, total: 10 } as CpuStat));
  }

  getMemoryStat(spaceId: string, environmentId: string): Observable<MemoryStat> {
    return Observable
      .interval(AppsService.POLL_RATE_MS)
      .distinctUntilChanged()
      .map(() => ({ used: Math.floor(Math.random() * 156) + 100, total: 256 } as MemoryStat));
  }
}
{'fraction_non_alphanumeric': 0.13299319727891157, 'fraction_numerical': 0.01292517006802721, 'mean_word_length': 4.337568058076225, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, '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': '1882633', 'n_tokens_mistral': 933, 'n_tokens_neox': 875, 'n_words': 223}