Skip to content

Commit

Permalink
bytes v2 (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeknovy authored Apr 5, 2021
1 parent b08a978 commit eabe6d1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/app/item-detail/item-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ <h2 *ngIf="itemData.overview.avgConnect < 1000 && itemData.overview.avgConnect >
</div>
</div>

<div class="col-sm" *ngIf="itemData.overview.bytesPerSecond && itemData.overview.bytesPerSecond !== 0">
<div class="col-sm" *ngIf="itemData.overview.bytesPerSecond && itemData.overview.bytesSentPerSecond && itemData.overview.bytesPerSecond !== 0">
<div class="card">
<div class="card-body overview-body">
<h2 class="card-title text-latency">{{convertBytesToMbps(itemData.overview.bytesPerSecond)}} <span
<h2 class="card-title text-latency">{{convertBytesToMbps(itemData.overview.bytesPerSecond + itemData.overview.bytesSentPerSecond)}} <span
class="unit-desc">Mbps</span>
</h2>
</div>
Expand Down Expand Up @@ -387,7 +387,7 @@ <h6 class="card-header bg-transparent">Request Statistics <span class="compare">
<td>{{_.throughput || "n/a"}} <sup
[className]="_.throughputDiff < 0 ? 'value-positive' : 'value-negative'"
*ngIf="_.throughputDiff">{{_.throughputDiff}}</sup></td>
<td>{{convertBytesToMbps(_.bytes * _.throughput) || "n/a"}} <sup
<td>{{convertBytesToMbps(_.bytesPerSecond + _.bytesSentPerSecond) || "n/a"}} <sup
[className]="_.bytesDiff < 0 ? 'value-positive' : 'value-negative'"
*ngIf="_.bytesDiff && bytesDiff !== 0">{{_.bytesDiff}}</sup></td>
<td>{{_.errorRate}} % <sup [className]="_.errorRateDiff > 0 ? 'value-positive' : 'value-negative'"
Expand Down
12 changes: 6 additions & 6 deletions src/app/item-detail/item-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ export class ItemDetailComponent implements OnInit {

private getChartLines() {
const { threads, overallTimeResponse,
overallThroughput, overAllFailRate, overallNetwork,
responseTime, throughput, network, minResponseTime, maxResponseTime, percentile90,
overallThroughput, overAllFailRate, overAllNetworkV2,
responseTime, throughput, networkV2, minResponseTime, maxResponseTime, percentile90,
percentile95, percentile99,
} = this.itemData.plot;

const threadLine = { ...threadLineSettings, name: 'virtual users', data: threads };
const errorLine = { ...errorLineSettings, ...overAllFailRate };
const throughputLine = { ...throughputLineSettings, ...overallThroughput };

if (overallNetwork) {
const networkMbps = overallNetwork.data.map((_) => {
if (overAllNetworkV2) {
const networkMbps = overAllNetworkV2.data.map((_) => {
return [_[0], bytesToMbps(_[1])];
});
const networkLine = { ...networkLineSettings, data: networkMbps };
Expand All @@ -134,8 +134,8 @@ export class ItemDetailComponent implements OnInit {
this.chartLines.overall.set('Error rate', errorLine);
this.chartLines.overall.set('Throughput', throughputLine);

if (network) {
const networkMbps = network.map((_) => {
if (networkV2) {
const networkMbps = networkV2.map((_) => {
_.data = _.data.map(__ => [__[0], bytesToMbps(__[1])]);
return _;
});
Expand Down
8 changes: 6 additions & 2 deletions src/app/items.service.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ export interface ItemDataPlot {
minResponseTime: LabelSeries[];
maxResponseTime: LabelSeries[];
throughput: LabelSeries[];
network: LabelSeries[];
networkV2: LabelSeries[];
networkUp: LabelSeries[];
networkDown: LabelSeries[];
percentile90?: LabelSeries[];
percentile95?: LabelSeries[];
percentile99?: LabelSeries[];
overallNetwork: any;
overAllNetworkV2: any;
overallNetworkUp: any;
overallNetworkDown: any;
overallTimeResponse: any;
overallThroughput: any;
overAllFailRate: any;
Expand Down

0 comments on commit eabe6d1

Please sign in to comment.