From b6f06902fe58af5a285cc380fca22f15832ab9c7 Mon Sep 17 00:00:00 2001 From: Ludek Novy <13610612+ludeknovy@users.noreply.github.com> Date: Wed, 25 Jan 2023 16:10:25 +0100 Subject: [PATCH] label error rate chart (#303) --- src/app/_services/item-chart.service.ts | 5 ++++- src/app/item-detail/label-chart/label-chart.component.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/_services/item-chart.service.ts b/src/app/_services/item-chart.service.ts index d665b9f5..a95cc80e 100644 --- a/src/app/_services/item-chart.service.ts +++ b/src/app/_services/item-chart.service.ts @@ -22,7 +22,7 @@ export class ItemChartService { threads, overallTimeResponse, overallThroughput, overAllFailRate, overAllNetworkV2, responseTime, throughput, networkV2, minResponseTime, maxResponseTime, percentile90, - percentile95, percentile99, statusCodes + percentile95, percentile99, statusCodes, errorRate, } = plot; const threadLine = { ...threadLineSettings, name: "virtual users", data: threads, tooltip: { valueSuffix: "" } }; @@ -78,6 +78,9 @@ export class ItemChartService { if (percentile99) { chartLines.labels.set(Metrics.ResponseTimeP99, percentile99.map((label) => ({ ...label, suffix: " ms" }))); } + if (errorRate) { + chartLines.labels.set(Metrics.ErrorRate, errorRate.map((label) => ({ ...label, suffix: " %" }))) + } chartLines.labels.set(Metrics.ResponseTimeAvg, responseTime.map((label) => ({ ...label, suffix: " ms" }))); chartLines.labels.set(Metrics.Throughput, throughput.map((label) => ({ ...label, suffix: " reqs/s" }))); 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 adc9b976..d392517a 100644 --- a/src/app/item-detail/label-chart/label-chart.component.ts +++ b/src/app/item-detail/label-chart/label-chart.component.ts @@ -37,6 +37,7 @@ export class LabelChartComponent implements OnChanges { [Metrics.ResponseTimeP90, commonGraphSettings("ms")], [Metrics.ResponseTimeP95, commonGraphSettings("ms")], [Metrics.ResponseTimeP99, commonGraphSettings("ms")], + [Metrics.ErrorRate, commonGraphSettings("%")] ]); constructor() { @@ -78,7 +79,7 @@ export class LabelChartComponent implements OnChanges { if (this.responseTimeMetricGroup.includes(metric)) { responseTimesSeries.push({ data: labelMetricsData.data, suffix: labelMetricsData.suffix, name: metric, yAxis: 0 }); } else { - this.labelCharts.set(metric, { ...chartSettings, series: [labelMetricsData, threadLine] }); + this.labelCharts.set(metric, { ...chartSettings, series: [{ data: labelMetricsData.data, suffix: labelMetricsData.suffix, name: metric }, threadLine] }); } }); this.labelCharts.set("Response Times", { ...commonGraphSettings("ms"), series: [...responseTimesSeries, threadLine] });