Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/szboynono/k6-html-reporter
A html reporter for k6
https://github.com/szboynono/k6-html-reporter
Last synced: about 1 month ago
JSON representation
A html reporter for k6
- Host: GitHub
- URL: https://github.com/szboynono/k6-html-reporter
- Owner: szboynono
- License: mit
- Created: 2020-12-06T02:29:12.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-19T14:18:46.000Z (about 3 years ago)
- Last Synced: 2024-03-25T08:01:33.742Z (9 months ago)
- Language: HTML
- Size: 8.89 MB
- Stars: 23
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-k6 - k6-html-reporter - Tool for generating k6 HTML reports. (Tools)
- awesome-k6 - k6-html-reporter - Tool for generating k6 HTML reports. (Tools)
README
# k6-html-reporter
A light weight html reporter for k6
[![Build Status](https://travis-ci.com/szboynono/k6-html-reporter.svg?branch=main)](https://travis-ci.com/szboynono/k6-html-reporter)
![npm](https://img.shields.io/npm/v/k6-html-reporter.svg)
![npm](https://img.shields.io/npm/dw/k6-html-reporter.svg)
## Install
NPM:``` bash
npm install k6-html-reporter --save-dev
```YARN:
```bash
yarn add k6-html-reporter --dev
```## Usage
1. Install the package
2. Create a js/ts file and specify the options:```js
const reporter = require('k6-html-reporter');
const options = {
jsonFile: ,
output: ,
};reporter.generateSummaryReport(options);
```for typescript
```ts
import {generateSummaryReport} from 'k6-html-reporter';const options = {
jsonFile: ,
output: ,
};generateSummaryReport(options);
```
3. Output a JSON summary output with the `handleSummary` function provided by k6, [more info](https://k6.io/docs/results-visualization/end-of-test-summary).
```js
export default function () { /** some tests here */}
export function handleSummary(data) {
console.log('Preparing the end-of-test summary...');
return {
: JSON.stringify(data),
}
}
```> **Note**: The ` --summary-export=path/to/file.json` run option is no longer recomanded after k6 v0.30.0.
4. Run the code in step two as a node.js script after the test execution:
```bash
node xxxx.js
```### Sample report:
![Alt text](./screenshot/k6.png?raw=true "Optional Title")