From 97ec0410d6610bbeacbdeacf10318e2aeb7b6237 Mon Sep 17 00:00:00 2001 From: Ludek Novy <13610612+ludeknovy@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:28:46 +0200 Subject: [PATCH] label chart median response time (#360) --- src/app/_services/chart-service-utils.ts | 7 ++++--- src/app/_services/item-chart.service.ts | 10 ++-------- .../item-detail/label-chart/label-chart.component.ts | 5 ++++- src/app/item-detail/metrics.ts | 1 + src/app/items.service.model.ts | 1 + 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/app/_services/chart-service-utils.ts b/src/app/_services/chart-service-utils.ts index dd3334cf..7cf255cb 100644 --- a/src/app/_services/chart-service-utils.ts +++ b/src/app/_services/chart-service-utils.ts @@ -6,7 +6,7 @@ export const getChartLines = (plot): ChartLines => { const { threads, overallTimeResponse, overallThroughput, overAllFailRate, overAllNetworkV2, - responseTime, throughput, networkV2, minResponseTime, maxResponseTime, percentile90, + responseTime, throughput, networkV2, minResponseTime, maxResponseTime, percentile50, percentile90, percentile95, percentile99, statusCodes, errorRate, scatterPlotData, threadsPerThreadGroup, } = plot; @@ -42,10 +42,8 @@ export const getChartLines = (plot): ChartLines => { if (threadsPerThreadGroup) { chartLines.threadsPerThreadGroup.set(Metrics.Threads, threadsPerThreadGroup) - } - if (scatterPlotData && scatterPlotData.length > 0) { chartLines.scatter.set(Metrics.ResponseTimeRaw, scatterPlotData) } @@ -66,6 +64,9 @@ export const getChartLines = (plot): ChartLines => { if (maxResponseTime) { chartLines.labels.set(Metrics.ResponseTimeMax, maxResponseTime.map((label) => ({ ...label, suffix: " ms" }))); } + if(percentile50) { + chartLines.labels.set(Metrics.ResponseTimeP50, percentile50.map((label) => ({ ...label, suffix: " ms" }))) + } if (percentile90) { chartLines.labels.set(Metrics.ResponseTimeP90, percentile90.map((label) => ({ ...label, suffix: " ms" }))); } diff --git a/src/app/_services/item-chart.service.ts b/src/app/_services/item-chart.service.ts index 3f14fcd8..615ef1e7 100644 --- a/src/app/_services/item-chart.service.ts +++ b/src/app/_services/item-chart.service.ts @@ -9,15 +9,9 @@ export class ItemChartService { private plot = new BehaviorSubject({ chartLines: null }); private plotRange = new BehaviorSubject({ start: null, end: null }); - private interval; selectedPlot$ = this.plot.asObservable(); - plotRange$ = this.plotRange.asObservable() - - - setInterval(interval) { - this.interval = interval; - } + plotRange$ = this.plotRange.asObservable(); setCurrentPlot(plot) { this.plot.next(getChartLines(plot)); @@ -28,7 +22,7 @@ export class ItemChartService { } getPlotRange() { - return this.plotRange.getValue() + return this.plotRange.getValue(); } } diff --git a/src/app/item-detail/label-chart/label-chart.component.ts b/src/app/item-detail/label-chart/label-chart.component.ts index 4384e552..f0a0b76d 100644 --- a/src/app/item-detail/label-chart/label-chart.component.ts +++ b/src/app/item-detail/label-chart/label-chart.component.ts @@ -45,6 +45,7 @@ export class LabelChartComponent implements OnChanges { [Metrics.ResponseTimeAvg, commonGraphSettings("ms")], [Metrics.ResponseTimeMax, commonGraphSettings("ms")], [Metrics.ResponseTimeMin, commonGraphSettings("ms")], + [Metrics.ResponseTimeP50, commonGraphSettings("ms")], [Metrics.ResponseTimeP90, commonGraphSettings("ms")], [Metrics.ResponseTimeP95, commonGraphSettings("ms")], [Metrics.ResponseTimeP99, commonGraphSettings("ms")], @@ -63,7 +64,9 @@ export class LabelChartComponent implements OnChanges { }; this.responseTimeMetricGroup = [ Metrics.ResponseTimeP90, Metrics.ResponseTimeAvg, Metrics.ResponseTimeMin, - Metrics.ResponseTimeMax, Metrics.ResponseTimeP95, Metrics.ResponseTimeP99]; + Metrics.ResponseTimeMax, Metrics.ResponseTimeP95, Metrics.ResponseTimeP99, + Metrics.ResponseTimeP50, + ]; } diff --git a/src/app/item-detail/metrics.ts b/src/app/item-detail/metrics.ts index 1fe03bb2..f57e7549 100644 --- a/src/app/item-detail/metrics.ts +++ b/src/app/item-detail/metrics.ts @@ -6,6 +6,7 @@ export enum Metrics { ResponseTimeAvg = "Response Time [avg]", ResponseTimeMin = "Response Time [min]", ResponseTimeMax = "Response Time [max]", + ResponseTimeP50 = "Response Time [P50]", ResponseTimeP90 = "Response Time [P90]", ResponseTimeP95 = "Response Time [P95]", ResponseTimeP99 = "Response Time [P99]", diff --git a/src/app/items.service.model.ts b/src/app/items.service.model.ts index 57eed7f7..74df9218 100644 --- a/src/app/items.service.model.ts +++ b/src/app/items.service.model.ts @@ -110,6 +110,7 @@ export interface ItemDataPlot { networkV2: LabelSeries[]; networkUp: LabelSeries[]; networkDown: LabelSeries[]; + percentile50?: LabelSeries[]; percentile90?: LabelSeries[]; percentile95?: LabelSeries[]; percentile99?: LabelSeries[];