-
{{bytesToMbps(itemData.overview.bytesPerSecond)}} Mbps
+ {{bytesToMbps(itemData.overview.bytesPerSecond)}} Mbps
diff --git a/src/app/item-detail/item-detail.component.scss b/src/app/item-detail/item-detail.component.scss
index 05259ab8..07068690 100644
--- a/src/app/item-detail/item-detail.component.scss
+++ b/src/app/item-detail/item-detail.component.scss
@@ -254,9 +254,26 @@ thead .hd {
}
.perf-issue {
- border-left: 2px solid #e74c3c;
+ border-left: 4px solid #e74c3c;
}
.perf-issue .card-body h6 {
font-size: 1rem !important;
}
+
+.perf-analysis-check {
+ margin-top: 10px;
+}
+
+.perf-analaysis-desc {
+ margin-left: 20px;
+}
+
+.performance-analysis-warning{
+ border-left: 4px solid #ffc107;
+
+}
+
+.performance-analysis-success{
+ border-left: 4px solid #28a745;
+}
diff --git a/src/app/item-detail/item-detail.component.ts b/src/app/item-detail/item-detail.component.ts
index ee9a11c8..cdbf01f6 100644
--- a/src/app/item-detail/item-detail.component.ts
+++ b/src/app/item-detail/item-detail.component.ts
@@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ItemsApiService } from '../items-api.service';
-import { ItemDetail } from '../items.service.model';
+import { ItemDetail, ItemStatistics } from '../items.service.model';
import { NgxSpinnerService } from 'ngx-spinner';
import { DecimalPipe } from '@angular/common';
import * as Highcharts from 'highcharts';
@@ -57,6 +57,7 @@ export class ItemDetailComponent implements OnInit {
comparisonWarning = [];
token: string;
isAnonymous = false;
+ perfAnalysis = { variability: null, onePerc: null };
constructor(
private route: ActivatedRoute,
@@ -87,8 +88,8 @@ export class ItemDetailComponent implements OnInit {
this.itemParams.projectName,
this.itemParams.scenarioName,
this.itemParams.id,
- { token: this.token}
- )
+ { token: this.token }
+ )
.pipe(catchError(r => {
this.spinner.hide();
return of(r);
@@ -97,6 +98,7 @@ export class ItemDetailComponent implements OnInit {
this.itemData = results;
this.labelsData = this.itemData.statistics;
this.hasErrorsAttachment = this.itemData.attachements.find((_) => _ === 'error');
+ this.performanceAnalaysis();
this.monitoringAlerts();
this.generateCharts();
this.spinner.hide();
@@ -243,7 +245,39 @@ export class ItemDetailComponent implements OnInit {
return Math.round(number * 100) / 100;
}
+ private performanceAnalaysis() {
+ const output = [];
+ this.itemData.statistics.forEach(_ => {
+ const variability = this.roundNumberTwoDecimals(_.avgResponseTime / _.minResponseTime);
+ const onePerc = this.roundNumberTwoDecimals(_.n9 / _.avgResponseTime);
+ output.push({
+ variability,
+ onePerc,
+ minResponseTime: _.minResponseTime,
+ avgResponseTime: _.avgResponseTime,
+ label: _.label
+ });
+ });
+
+ const variabilitySorted = output.sort((a, b) => b.variablity - a.variablity);
+ const onePercSorted = output.sort((a, b) => b.onePerc - a.onePerc);
+
+ this.perfAnalysis = {
+ variability: {
+ value: variabilitySorted[0].variability,
+ avgResponseTime: variabilitySorted[0].avgResponseTime,
+ minResponseTime: variabilitySorted[0].minResponseTime,
+ failed: variabilitySorted[0].variability > 2.5
+ },
+ onePerc: {
+ value: onePercSorted[0].onePerc,
+ avgResponseTime: onePercSorted[0].onePerc.avgResponseTime,
+ failed: onePercSorted[0].onePerc > 2.5
+ },
+ };
+ }
+
bytesToMbps(bytes) {
return this.roundNumberTwoDecimals(bytes / Math.pow(1024, 2));
-}
+ }
}
diff --git a/src/app/items.service.model.ts b/src/app/items.service.model.ts
index 5b6b7eca..d5df5872 100644
--- a/src/app/items.service.model.ts
+++ b/src/app/items.service.model.ts
@@ -32,7 +32,7 @@ export interface ItemDetail {
throughput: number
};
reportStatus: ReportStatus;
- monitoringData: { cpu: [], mem: [], maxCpu?: number, maxMem?: number};
+ monitoringData: { cpu: [], mem: [], maxCpu?: number, maxMem?: number };
baseId: string;
testName: string;
note: string;
@@ -55,18 +55,32 @@ export interface ItemDetail {
threads: any;
};
- statistics: any;
+ statistics: ItemStatistics[];
attachements: [];
thresholds?: {
passed: boolean,
diff: {
errorRateDiff: number,
- percentileRateDiff: number,
- throughputRateDiff: number
+ percentileRateDiff: number,
+ throughputRateDiff: number
}
};
}
+export interface ItemStatistics {
+ avgResponseTime: number;
+ bytes: number;
+ errorRate: number;
+ label: string;
+ maxResponseTime: number;
+ minResponseTime: number;
+ n0: number;
+ n5: number;
+ n9: number;
+ samples: number;
+ throughput: number;
+}
+
interface MonitoringData {
'bytes-recv'?: string;
'bytes-sent'?: string;