]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+admin/request-schedulers/shared/request-schedulers-stats-attributes.model.ts
Formated -> Formatted
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / request-schedulers / shared / request-schedulers-stats-attributes.model.ts
CommitLineData
0aef76c4 1import { RequestSchedulerStatsAttributes as FormattedRequestSchedulerStatsAttributes } from '../../../../../../shared'
154898b0 2
bed3143e 3export interface Request {
df98563e
C
4 request: any
5 to: any
bed3143e
C
6}
7
0aef76c4 8export class RequestSchedulerStatsAttributes implements FormattedRequestSchedulerStatsAttributes {
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}