]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/admin/requests/shared/request-stats.model.ts
Server: fix remaining milli seconds before the next requests feature
[github/Chocobozzz/PeerTube.git] / client / src / app / admin / requests / shared / request-stats.model.ts
CommitLineData
bed3143e
C
1export interface Request {
2 request: any;
3 to: any;
4}
5
6export class RequestStats {
eb4f957e
C
7 milliSecondsInterval: number;
8 remainingMilliSeconds: number;
bed3143e
C
9 requests: Request[];
10
11 constructor(hash: {
12 milliSecondsInterval: number,
13 remainingMilliSeconds: number,
14 requests: Request[];
15 }) {
16 this.milliSecondsInterval = hash.milliSecondsInterval;
17 this.remainingMilliSeconds = hash.remainingMilliSeconds;
18 this.requests = hash.requests;
19 }
20
21 get remainingSeconds() {
22 return Math.floor(this.remainingMilliSeconds / 1000);
23 }
24
25 get secondsInterval() {
26 return Math.floor(this.milliSecondsInterval / 1000);
27 }
28
eb4f957e 29}