]>
Commit | Line | Data |
---|---|---|
154898b0 C |
1 | import { RequestSchedulerAttributes as FormatedRequestSchedulerAttributes } from '../../../../../../shared' |
2 | ||
bed3143e | 3 | export interface Request { |
df98563e C |
4 | request: any |
5 | to: any | |
bed3143e C |
6 | } |
7 | ||
154898b0 | 8 | export class RequestSchedulerStatsAttributes implements FormatedRequestSchedulerAttributes { |
df98563e C |
9 | requestsLimitPods: number |
10 | requestsLimitPerPod: number | |
11 | milliSecondsInterval: number | |
12 | remainingMilliSeconds: number | |
13 | totalRequests: number | |
bed3143e | 14 | |
df98563e | 15 | constructor (hash: { |
872a4c7c C |
16 | requestsLimitPods: number, |
17 | requestsLimitPerPod: number, | |
bed3143e C |
18 | milliSecondsInterval: number, |
19 | remainingMilliSeconds: number, | |
df98563e | 20 | totalRequests: number |
bed3143e | 21 | }) { |
df98563e C |
22 | this.requestsLimitPods = hash.requestsLimitPods |
23 | this.requestsLimitPerPod = hash.requestsLimitPerPod | |
24 | this.milliSecondsInterval = hash.milliSecondsInterval | |
25 | this.remainingMilliSeconds = hash.remainingMilliSeconds | |
26 | this.totalRequests = hash.totalRequests | |
bed3143e C |
27 | } |
28 | ||
df98563e C |
29 | get remainingSeconds () { |
30 | return Math.floor(this.remainingMilliSeconds / 1000) | |
bed3143e C |
31 | } |
32 | ||
df98563e C |
33 | get secondsInterva () { |
34 | return Math.floor(this.milliSecondsInterval / 1000) | |
bed3143e C |
35 | } |
36 | ||
eb4f957e | 37 | } |