<h3>Requests stats</h3>
<div *ngIf="stats !== null">
- <div>
- <span class="label-description">Interval seconds between requests:</span>
- {{ stats.secondsInterval }}
- </div>
+ <div class="requests-general">
+ <div>
+ <span class="label-description">Remaining requests:</span>
+ {{ stats.totalRequests }}
+ </div>
- <div>
- <span class="label-description">Remaining time before the scheduled request:</span>
- {{ stats.remainingSeconds }}
- </div>
+ <div>
+ <span class="label-description">Interval seconds between requests:</span>
+ {{ stats.secondsInterval }}
+ </div>
- <div>
- <span class="label-description">Maximum number of requests per interval:</span>
- {{ stats.maxRequestsInParallel }}
+ <div>
+ <span class="label-description">Remaining time before the scheduled request:</span>
+ {{ stats.remainingSeconds }}
+ </div>
</div>
- <div>
- <span class="label-description">Remaining requests:</span>
- {{ stats.totalRequests }}
+ <div class="requests-limit">
+ <div>
+ <span class="label-description">Maximum number of different pods for a scheduled request:</span>
+ {{ stats.requestsLimitPods }}
+ </div>
+
+ <div>
+ <span class="label-description">Maximum number of requests per pod for a scheduled request:</span>
+ {{ stats.requestsLimitPerPod }}
+ </div>
</div>
+
</div>
.label-description {
display: inline-block;
- width: 350px;
font-weight: bold;
color: black;
}
+
+.requests-general {
+ .label-description {
+ width: 320px;
+ }
+}
+
+.requests-limit {
+ margin-top: 20px;
+
+ .label-description {
+ width: 430px;
+ }
+}
ngOnInit() {
this.getStats();
+ this.runInterval();
}
ngOnDestroy() {
getStats() {
this.requestService.getStats().subscribe(
- stats => {
- this.stats = stats;
- this.runInterval();
- },
+ stats => this.stats = stats,
err => alert(err.text)
);
if (this.stats.remainingMilliSeconds <= 0) {
setTimeout(() => this.getStats(), this.stats.remainingMilliSeconds + 100);
- clearInterval(this.interval);
}
}, 1000);
}
}
export class RequestStats {
- maxRequestsInParallel: number;
+ requestsLimitPods: number;
+ requestsLimitPerPod: number;
milliSecondsInterval: number;
remainingMilliSeconds: number;
totalRequests: number;
constructor(hash: {
- maxRequestsInParallel: number,
+ requestsLimitPods: number,
+ requestsLimitPerPod: number,
milliSecondsInterval: number,
remainingMilliSeconds: number,
totalRequests: number;
}) {
- this.maxRequestsInParallel = hash.maxRequestsInParallel;
+ this.requestsLimitPods = hash.requestsLimitPods;
+ this.requestsLimitPerPod = hash.requestsLimitPerPod;
this.milliSecondsInterval = hash.milliSecondsInterval;
this.remainingMilliSeconds = hash.remainingMilliSeconds;
this.totalRequests = hash.totalRequests;
return res.json({
totalRequests: totalRequests,
- maxRequestsInParallel: constants.REQUESTS_IN_PARALLEL,
+ requestsLimitPods: constants.REQUESTS_LIMIT_PODS,
+ requestsLimitPerPod: constants.REQUESTS_LIMIT_PER_POD,
remainingMilliSeconds: db.Request.remainingMilliSeconds(),
milliSecondsInterval: constants.REQUESTS_INTERVAL
})