-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a448343
commit d3c3b04
Showing
3 changed files
with
204 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
<template> | ||
<div class="tile"> | ||
<div class="tile is-parent"> | ||
<div class="card tile is-child"> | ||
<div class="card-content"> | ||
<div class="columns"> | ||
<div class="column"> | ||
<span class="title">{{ Math.floor(summary.throughput) }}</span> | ||
<p class="content">response / seconds</p> | ||
</div> | ||
<div class="column has-text-right is-one-fifth m-1"> | ||
<span class="icon is-large"><i class="fas fa-space-shuttle fa-3x"></i></span> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="card-footer"> | ||
<div class="card-footer-item has-text-left"> | ||
<div class="content"> | ||
Total requests: <strong>{{ summary.requests }}</strong> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="tile is-parent"> | ||
<div class="card tile is-child"> | ||
<div class="card-content"> | ||
<div class="columns"> | ||
<div class="column"> | ||
<span class="title">{{ (summary.meanLatencies / 1000000).toFixed(1) }}ms</span> | ||
<p class="content">avg response time</p> | ||
</div> | ||
<div class="column has-text-right is-one-fifth m-1"> | ||
<span class="icon is-large"><i class="fas fa-hourglass-end fa-3x"></i></span> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="card-footer"> | ||
<div class="card-footer-item has-text-left"> | ||
P50: <strong>{{ (summary.meanP50Latencies / 1000000).toFixed(1) }}ms</strong> | ||
</div> | ||
<div class="card-footer-item has-text-left"> | ||
P95: <strong>{{ (summary.meanP95Latencies / 1000000).toFixed(1) }}ms</strong> | ||
</div> | ||
<div class="card-footer-item has-text-left"> | ||
P99: <strong>{{ (summary.meanP99Latencies / 1000000).toFixed(1) }}ms</strong> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="tile is-parent"> | ||
<div class="card tile is-child"> | ||
<div class="card-content"> | ||
<div class="columns"> | ||
<div class="column"> | ||
<span class="title">{{ Math.floor(summary.success * 100) }}%</span> | ||
<p class="content">success rate</p> | ||
</div> | ||
<div class="column has-text-right is-one-fifth m-1"> | ||
<span class="icon is-large"><i class="fas fa-chart-pie fa-3x"></i></span> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="card-footer"> | ||
<div class="card-footer-item has-text-left"> | ||
2xx: <strong>{{ summary.statusCodes['2xx'] }}</strong> | ||
</div> | ||
<div class="card-footer-item has-text-left"> | ||
4xx: <strong>{{ summary.statusCodes['4xx'] }}</strong> | ||
</div> | ||
<div class="card-footer-item has-text-left"> | ||
5xx: <strong>{{ summary.statusCodes['5xx'] }}</strong> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="tile is-parent"> | ||
<div class="card tile is-child"> | ||
<div class="card-content"> | ||
<div class="columns"> | ||
<div class="column"> | ||
<span class="title">{{ formatBytes(summary.totalBytesIn, 2) }}</span> | ||
<p class="content">bytes in</p> | ||
</div> | ||
<div class="column has-text-right is-one-fifth m-1"> | ||
<span class="icon is-large"><i class="fas fa-exchange-alt fa-3x"></i></span> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="card-footer"> | ||
<div class="card-footer-item has-text-left"> | ||
Bytes out: <strong>{{ formatBytes(summary.totalBytesOut, 2) }}</strong> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'ResultSummary', | ||
props: { | ||
summary: Object, | ||
}, | ||
methods: { | ||
formatBytes(bytes, decimals = 2) { | ||
if (bytes === 0) return '0 Byte'; | ||
const k = 1024; | ||
const dm = decimals < 0 ? 0 : decimals; | ||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; | ||
const i = Math.floor(Math.log(bytes) / Math.log(k)); | ||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]; | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> |