Skip to content

Commit

Permalink
label chart median response time (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeknovy authored Sep 8, 2023
1 parent f7159c7 commit 97ec041
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
7 changes: 4 additions & 3 deletions src/app/_services/chart-service-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
}
Expand All @@ -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" })));
}
Expand Down
10 changes: 2 additions & 8 deletions src/app/_services/item-chart.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@ export class ItemChartService {

private plot = new BehaviorSubject<ChartLines>({ chartLines: null });
private plotRange = new BehaviorSubject<PlotRange>({ 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));
Expand All @@ -28,7 +22,7 @@ export class ItemChartService {
}

getPlotRange() {
return this.plotRange.getValue()
return this.plotRange.getValue();
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/app/item-detail/label-chart/label-chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")],
Expand All @@ -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,
];
}


Expand Down
1 change: 1 addition & 0 deletions src/app/item-detail/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand Down
1 change: 1 addition & 0 deletions src/app/items.service.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export interface ItemDataPlot {
networkV2: LabelSeries[];
networkUp: LabelSeries[];
networkDown: LabelSeries[];
percentile50?: LabelSeries[];
percentile90?: LabelSeries[];
percentile95?: LabelSeries[];
percentile99?: LabelSeries[];
Expand Down

0 comments on commit 97ec041

Please sign in to comment.