Skip to content

Commit

Permalink
fix throughput analysis (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeknovy authored Mar 9, 2021
1 parent e154845 commit 776b6f1
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions src/app/item-detail/item-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,37 @@ export class ItemDetailComponent implements OnInit {
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
},
throughputVariability: this.calculateThroughputVariability()
};
}

private calculateThroughputVariability() {
const { overallThroughput, threads } = this.itemData.plot;
const { maxVu, throughput } = this.itemData.overview;
const rampUpIndex = threads.map(_ => _[1]).indexOf(maxVu);

const throughputValues = overallThroughput.data.slice(rampUpIndex, -2).map(_ => _[1]);
if (throughputValues.length === 0) {
return {
value: null,
failed: false,
bandValues: []
};
}
const minThroughput = Math.min(...throughputValues);
const minThroughputIndex = throughputValues.indexOf(minThroughput);
const maxBandIndex = throughputValues.length;
Expand All @@ -290,23 +316,10 @@ export class ItemDetailComponent implements OnInit {
];
const throughputVariability = this.roundNumberTwoDecimals(100 - (minThroughput / throughput) * 100);

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
},
throughputVariability: {
return {
value: throughputVariability,
failed: throughputVariability > 20,
bandValues: throughputBandValues
}
};
}

Expand Down

0 comments on commit 776b6f1

Please sign in to comment.