]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/admin/requests/shared/request-stats.model.ts
Client: split in angular modules
[github/Chocobozzz/PeerTube.git] / client / src / app / admin / requests / shared / request-stats.model.ts
1 export interface Request {
2 request: any;
3 to: any;
4 }
5
6 export class RequestStats {
7 maxRequestsInParallel: number;
8 milliSecondsInterval: number;
9 remainingMilliSeconds: number;
10 requests: Request[];
11
12 constructor(hash: {
13 maxRequestsInParallel: number,
14 milliSecondsInterval: number,
15 remainingMilliSeconds: number,
16 requests: Request[];
17 }) {
18 this.maxRequestsInParallel = hash.maxRequestsInParallel;
19 this.milliSecondsInterval = hash.milliSecondsInterval;
20 this.remainingMilliSeconds = hash.remainingMilliSeconds;
21 this.requests = hash.requests;
22 }
23
24 get remainingSeconds() {
25 return Math.floor(this.remainingMilliSeconds / 1000);
26 }
27
28 get secondsInterval() {
29 return Math.floor(this.milliSecondsInterval / 1000);
30 }
31
32 }