diff --git a/src/app/_services/comparison-stats.service.spec.ts b/src/app/_services/comparison-stats.service.spec.ts new file mode 100644 index 00000000..67b80999 --- /dev/null +++ b/src/app/_services/comparison-stats.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from "@angular/core/testing"; + +import { ComparisonStatsService } from "./comparison-stats.service"; + +describe("ComparisonStatsService", () => { + let service: ComparisonStatsService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(ComparisonStatsService); + }); + + it("should be created", () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/_services/comparison-stats.service.ts b/src/app/_services/comparison-stats.service.ts new file mode 100644 index 00000000..fb6c7bdd --- /dev/null +++ b/src/app/_services/comparison-stats.service.ts @@ -0,0 +1,19 @@ +import { Injectable } from "@angular/core"; +import { BehaviorSubject } from "rxjs"; +import { ItemStatistics } from "../items.service.model"; + +@Injectable({ + providedIn: 'root' +}) +export class ComparisonStatsService { + + private requestStats = new BehaviorSubject([]); + + requestStats$ = this.requestStats.asObservable(); + + + setRequestStats(data: ItemStatistics[]) { + this.requestStats.next(data); + } + +} diff --git a/src/app/item-detail/item-detail.component.html b/src/app/item-detail/item-detail.component.html index 739f1edb..dc726020 100644 --- a/src/app/item-detail/item-detail.component.html +++ b/src/app/item-detail/item-detail.component.html @@ -9,6 +9,8 @@ + +
@@ -96,13 +98,13 @@
Test failure
Overview requests: {{totalRequests | number}}
+ class="total-samples"> requests: {{ totalRequests | number }}
-

{{itemData.overview.maxVu}}

+

{{ itemData.overview.maxVu }}

@@ -112,9 +114,11 @@

{{itemData.overview.maxVu}}

-

{{itemData.overview.throughput > 1000 ? - Math.round(itemData.overview.throughput) : itemData.overview.throughput}} reqs/s +

{{ + itemData.overview.throughput > 1000 ? + Math.round(itemData.overview.throughput) : itemData.overview.throughput + }} reqs/s

-
+
-

{{ - Math.round(((itemData.overview.percentil || itemData.overview.percentile90) / 1000) * 100) / 100}} s +

{{ + Math.round(((itemData.overview.percentil || itemData.overview.percentile90) / 1000) * 100) / 100 + }} s

-

{{ - itemData.overview.percentil || itemData.overview.percentile90}} ms +

{{ + itemData.overview.percentil || itemData.overview.percentile90 + }} ms

@@ -144,12 +153,15 @@

{{ - Math.round((itemData.overview.percentile95 / 1000) * 100) / 100}} s + Math.round((itemData.overview.percentile95 / 1000) * 100) / 100 + }} s

{{ - itemData.overview.percentile95}} ms + itemData.overview.percentile95 + }} ms

-

N/A ms

+

N/A ms

@@ -160,12 +172,15 @@

N/A

{{ - Math.round((itemData.overview.percentile99 / 1000) * 100) / 100}} s + Math.round((itemData.overview.percentile99 / 1000) * 100) / 100 + }} s

{{ - itemData.overview.percentile99}} ms + itemData.overview.percentile99 + }} ms

-

N/A ms

+

N/A ms

@@ -175,11 +190,13 @@

N/A

{{ - Math.round((itemData.overview.avgResponseTime / 1000) * 100) / 100}} s

{{ - itemData.overview.avgResponseTime}} ms + itemData.overview.avgResponseTime + }} ms

@@ -190,11 +207,13 @@

{{

{{ - Math.round((itemData.overview.avgLatency / 1000) * 100) / 100}} s + Math.round((itemData.overview.avgLatency / 1000) * 100) / 100 + }} s

{{ - itemData.overview.avgLatency}} ms + itemData.overview.avgLatency + }} ms