From efcb0dbc1b80dcb0829c4310f9917a74941d01c9 Mon Sep 17 00:00:00 2001 From: Ludek <13610612+ludeknovy@users.noreply.github.com> Date: Fri, 5 Mar 2021 17:16:43 +0100 Subject: [PATCH] perf analysis (#102) --- .../item-detail/item-detail.component.html | 61 +++++++++++++++---- .../item-detail/item-detail.component.scss | 19 +++++- src/app/item-detail/item-detail.component.ts | 42 +++++++++++-- src/app/items.service.model.ts | 22 +++++-- 4 files changed, 122 insertions(+), 22 deletions(-) diff --git a/src/app/item-detail/item-detail.component.html b/src/app/item-detail/item-detail.component.html index 8fc707a2..a22d9bde 100644 --- a/src/app/item-detail/item-detail.component.html +++ b/src/app/item-detail/item-detail.component.html @@ -58,21 +58,19 @@
-

90 percentile decrease toleration: {{itemData.thresholds.thresholds.percentile}} % -

-

- Througput decrease toleration: {{itemData.thresholds.thresholds.throughput}}% -

-

- Error rate increase toleration: {{itemData.thresholds.thresholds.errorRate}}% -

+

90 percentile decrease toleration: {{itemData.thresholds.thresholds.percentile}} % +

+

+ Througput decrease toleration: {{itemData.thresholds.thresholds.throughput}}% +

+

+ Error rate increase toleration: {{itemData.thresholds.thresholds.errorRate}}% +

-
+
Performance regression issue detected!
+ placement="bottom" [ngbTooltip]="tipContent">
  • 90 percentile response time is about {{ Math.round(itemData.thresholds.result.percentile.diffValue - 100) }}% slower than the average. @@ -87,6 +85,42 @@
    Performance regression issue detected!
+
+
+
+
+
Performance Analysis
+
+
+ Slowest responses
+
+ The 1% of slowest responses do not have a significant deviation from the average response time. +
+
+ The 1% of response times shows up to {{ perfAnalysis.onePerc.value }}x slower response times than the + average. This might mean a performance issue for some clients and indicates that SUT might have been + overloaded. +
+
+ +
+
+ Steady performance
+
+ Increased variability between the fastest and the average response time was detected (up to {{perfAnalysis.variability.value}}x). The SUT might have been overloaded. +
+
+ The SUT was providing balanced response times across all labels. +
+
+
+
+
+ +
+
@@ -180,7 +214,8 @@

-

{{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;