blob: 394acc73d5e25b68bf0850e4a0fdf89a92fd8006 (
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
36
37
|
import { RequestSchedulerAttributes as FormatedRequestSchedulerAttributes } from '../../../../../../shared'
export interface Request {
request: any
to: any
}
export class RequestSchedulerStatsAttributes implements FormatedRequestSchedulerAttributes {
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)
}
}
|