aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/requests/shared/request-stats.model.ts
blob: 31550b5c08f1c091f146bb8c6b0f090f52efc9c5 (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 secondsInterva () {
    return Math.floor(this.milliSecondsInterval / 1000)
  }

}