aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/requests/shared/request-stats.model.ts
blob: f658c468260e10ca0b5cfe2387e40b6d627a82a5 (plain) (blame)
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
26
27
28
29
30
31
32
33
34
35
export interface Request {
  request: any;
  to: any;
}

export class RequestStats {
  requestsLimitPods: number;
  requestsLimitPerPod: number;
  milliSecondsInterval: number;
  remainingMilliSeconds: number;
  totalRequests: number;

  constructor(hash: {
    requestsLimitPods: number,
    requestsLimitPerPod: number,
    milliSecondsInterval: number,
    remainingMilliSeconds: number,
    totalRequests: number;
  }) {
    this.requestsLimitPods = hash.requestsLimitPods;
    this.requestsLimitPerPod = hash.requestsLimitPerPod;
    this.milliSecondsInterval = hash.milliSecondsInterval;
    this.remainingMilliSeconds = hash.remainingMilliSeconds;
    this.totalRequests = hash.totalRequests;
  }

  get remainingSeconds() {
    return Math.floor(this.remainingMilliSeconds / 1000);
  }

  get secondsInterval() {
    return Math.floor(this.milliSecondsInterval / 1000);
  }

}