Skip to content

Commit

Permalink
request stats failure (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeknovy authored Jun 5, 2023
1 parent b3da63a commit 0da5057
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/app/item-detail/item-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ <h6 class="card-header bg-transparent">Target System Statistics <span class="com
<th scope="col" class="hd jtl-head-color">
<mfDefaultSorter by="errorRate">error rate [%]</mfDefaultSorter>
</th>
<th scope="col" class="hd jtl-head-color">
<mfDefaultSorter by="errorRate">error rate [%]</mfDefaultSorter>
</th>
<th scope="col" class="hd jtl-head-color">
</th>
<th scope="col" class="hd jtl-head-color">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ <h6 class="card-header bg-transparent">Request Statistics <span class="compare">
*ngIf="displayColumn(itemData.userSettings?.requestStats?.errorRate)">
<mfDefaultSorter by="errorRate">error rate [%]</mfDefaultSorter>
</th>
<th scope="col" class="hd jtl-head-color"
*ngIf="displayColumn(itemData.userSettings?.requestStats?.failures, false)">
<mfDefaultSorter by="failures">failures</mfDefaultSorter>
</th>
<th scope="col" class="hd jtl-head-color"
*ngIf="displayColumn(itemData.userSettings?.requestStats?.apdex, false)">
<mfDefaultSorter [by]="sortByApdex">apdex</mfDefaultSorter>
Expand Down Expand Up @@ -159,6 +163,10 @@ <h6 class="card-header bg-transparent">Request Statistics <span class="compare">
<span
[className]="comparedData ? _.errorRate > 0 ? 'value-positive' : 'value-negative' : ''">{{_.errorRate | number: '1.0-2'}}</span>
</td>
<td *ngIf="displayColumn(itemData.userSettings?.requestStats?.failures, false)">
<span
[className]="comparedData ? _.failures > 0 ? 'value-positive' : 'value-negative' : ''">{{_.failures | number: '1.0-2'}}</span>
</td>
<td *ngIf="displayColumn(itemData.userSettings?.requestStats?.apdex, false)">
<span>
{{ calculateApdex(_.apdex?.satisfaction, _.apdex?.toleration, _.samples)}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ describe("RequestStatsCompareComponent", () => {
p95: true,
apdex: true,
standardDeviation: true,
failures: true,
}
},
baseId: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ export class RequestStatsCompareComponent implements OnInit, OnDestroy {
}

ngOnInit() {
// enrich the data with failure count
this.itemData.statistics.map(labelData => {
const failureCount = labelData.responseMessageFailures.reduce(
(previousValue, currentValue) => {
previousValue.count += currentValue.count
return previousValue
},{ count: 0 })

Object.assign(labelData, { failures: failureCount.count })
return labelData
})

if (this.itemData?.thresholds?.passed === false) {
this.labelsData = this.itemData.statistics.map(labelData => {
const thresholdResult = this.itemData.thresholds.results.find(thresholdResult =>
Expand All @@ -65,6 +77,7 @@ export class RequestStatsCompareComponent implements OnInit, OnDestroy {
} else {
this.labelsData = this.itemData.statistics;
}
console.log(this.labelsData)
this.analyzeChartService.currentData.subscribe(data => {
if (data && data.label) {
this.search(data.label);
Expand Down
1 change: 1 addition & 0 deletions src/app/scenario.service.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ export interface RequestStats {
throughput: boolean
apdex: boolean
standardDeviation: boolean
failures: boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ <h6>Generate extra chart aggregations <i class="fas fa-flask"></i></h6>
formControlName="errorRate">
<label class="custom-control-label" for="rs-error-rate">Error Rate</label>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="rs-failures"
formControlName="failures">
<label class="custom-control-label" for="rs-failures">Failures</label>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="rs-apdex"
formControlName="apdex">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class SettingsScenarioComponent implements OnInit {
avgConnectionTime: null,
avgLatency: null,
errorRate: null,
failures: null,
};
labelFilterControls = {};
requestStatsCormControls = {
Expand All @@ -64,7 +65,8 @@ export class SettingsScenarioComponent implements OnInit {
network: null,
errorRate: null,
apdex: null,
standardDeviation: null
standardDeviation: null,
failures: null
};
apdexFormControls = {
apdexEnabled: null,
Expand Down Expand Up @@ -206,6 +208,8 @@ export class SettingsScenarioComponent implements OnInit {
this.labelTrendChartControls.p95 = new FormControl(settings.labelTrendChartSettings?.p95, []);
this.labelTrendChartControls.p99 = new FormControl(settings.labelTrendChartSettings?.p99, []);
this.labelTrendChartControls.errorRate = new FormControl(settings.labelTrendChartSettings?.errorRate, []);
this.labelTrendChartControls.failures = new FormControl(settings.labelTrendChartSettings?.failures, []);


this.requestStatsCormControls.samples = new FormControl(settings.userSettings.requestStats.samples, [Validators.required]);
this.requestStatsCormControls.avg = new FormControl(settings.userSettings.requestStats.avg, [Validators.required]);
Expand All @@ -218,6 +222,7 @@ export class SettingsScenarioComponent implements OnInit {
this.requestStatsCormControls.throughput = new FormControl(settings.userSettings.requestStats.throughput, [Validators.required]);
this.requestStatsCormControls.network = new FormControl(settings.userSettings.requestStats.network, [Validators.required]);
this.requestStatsCormControls.errorRate = new FormControl(settings.userSettings.requestStats.errorRate, [Validators.required]);
this.requestStatsCormControls.failures = new FormControl(settings.userSettings.requestStats.failures, [Validators.required]);
this.requestStatsCormControls.apdex = new FormControl(settings.userSettings.requestStats.apdex || false, [Validators.required]);

this.apdexFormControls.satisfyingThreshold = new FormControl(settings?.apdexSettings?.satisfyingThreshold, [
Expand Down Expand Up @@ -267,6 +272,7 @@ export class SettingsScenarioComponent implements OnInit {
throughput: this.requestStatsCormControls.throughput,
network: this.requestStatsCormControls.network,
errorRate: this.requestStatsCormControls.errorRate,
failures: this.requestStatsCormControls.failures,
apdex: this.requestStatsCormControls.apdex,
standardDeviation: this.requestStatsCormControls.standardDeviation,
});
Expand Down

0 comments on commit 0da5057

Please sign in to comment.