aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/admin/requests/shared/request-stats.model.ts
blob: 49ecbc79e868494851b328c755491d17baaf8c1d (plain) (tree)
1
2
3
4
5
6
7
8
9





                           
                                
                               
                                
                        

                     
                                  

                                  
                          
      
                                                            

                                                            
                                            









                                                         
 
export interface Request {
  request: any;
  to: any;
}

export class RequestStats {
  maxRequestsInParallel: number;
  milliSecondsInterval: number;
  remainingMilliSeconds: number;
  totalRequests: number;

  constructor(hash: {
    maxRequestsInParallel: number,
    milliSecondsInterval: number,
    remainingMilliSeconds: number,
    totalRequests: number;
  }) {
    this.maxRequestsInParallel = hash.maxRequestsInParallel;
    this.milliSecondsInterval = hash.milliSecondsInterval;
    this.remainingMilliSeconds = hash.remainingMilliSeconds;
    this.totalRequests = hash.totalRequests;
  }

  get remainingSeconds() {
    return Math.floor(this.remainingMilliSeconds / 1000);
  }

  get secondsInterval() {
    return Math.floor(this.milliSecondsInterval / 1000);
  }

}