{"id":13651631,"url":"https://github.com/benc-uk/k6-reporter","last_synced_at":"2025-04-06T04:12:17.705Z","repository":{"id":37737500,"uuid":"327669478","full_name":"benc-uk/k6-reporter","owner":"benc-uk","description":"Output K6 test run results as formatted \u0026 easy to read HTML reports","archived":false,"fork":false,"pushed_at":"2023-08-11T06:44:46.000Z","size":328,"stargazers_count":321,"open_issues_count":20,"forks_count":76,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-01-25T06:10:40.245Z","etag":null,"topics":["html-report","k6","load-testing"],"latest_commit_sha":null,"homepage":"","language":"EJS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benc-uk.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-01-07T16:40:33.000Z","updated_at":"2024-01-24T11:35:22.000Z","dependencies_parsed_at":"2024-01-03T05:40:30.240Z","dependency_job_id":"8c13c898-62f1-49a7-84c1-5fe679b6d610","html_url":"https://github.com/benc-uk/k6-reporter","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benc-uk%2Fk6-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benc-uk%2Fk6-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benc-uk%2Fk6-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benc-uk%2Fk6-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benc-uk","download_url":"https://codeload.github.com/benc-uk/k6-reporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430872,"owners_count":20937874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html-report","k6","load-testing"],"created_at":"2024-08-02T02:00:51.082Z","updated_at":"2025-04-06T04:12:17.679Z","avatar_url":"https://github.com/benc-uk.png","language":"EJS","funding_links":[],"categories":["Tools","Performance Testing"],"sub_categories":["Results Analysis \u0026 Reporting"],"readme":"# K6 HTML Report Exporter v2\n\n### 🔥 Note.\n\n\u003e This a complete rewrite/overhaul of the existing report converter, now written in JavaScript to be integrated into the test. This is a more elegant method than the offline conversation process. The previous code has been moved to the 'archive' folder.\n\nThe report will show all request groups, checks, HTTP metrics and other statistics\n\nAny HTTP metrics which have failed thresholds will be highlighted in red. Any group checks with more than 0 failures will also be shown in red.\n\n![](https://img.shields.io/github/license/benc-uk/k6-reporter)\n![](https://img.shields.io/github/last-commit/benc-uk/k6-reporter)\n![](https://img.shields.io/github/release/benc-uk/k6-reporter)\n![](https://img.shields.io/github/checks-status/benc-uk/k6-reporter/main)\n\n# Usage\n\nThis extension to K6 is intended to be used by adding into your K6 test code (JavaScript) and utilizes the _handleSummary_ callback hook, added to K6 v0.30.0. When your test completes a HTML file will be written to the filesystem, containing a formatted and easy to consume version of the test summary data\n\nTo use, add this module to your test code.\n\nImport the `htmlReport` function from the bundled module hosted remotely on GitHub\n\n```js\nimport { htmlReport } from \"https://raw.githubusercontent.com/benc-uk/k6-reporter/main/dist/bundle.js\";\n```\n\n\u003e Note. Replace `main` with a version tag (e.g. `2.2.0`) to use a specific version\n\nThen outside the test's default function, wrap it with the `handleSummary(data)` function which [K6 calls at the end of any test](https://github.com/loadimpact/k6/pull/1768), as follows:\n\n```js\nexport function handleSummary(data) {\n  return {\n    \"summary.html\": htmlReport(data),\n  };\n}\n```\n\nThe key used in the returned object is the filename that will be written to, and can be any valid filename or path  \n**Note. This is a change in the v2.1.1 release**\n\nThe **htmlReport** function accepts an optional options map as a second parameter, with the following properties\n\n```ts\ntitle    string  // Title of the report, defaults to current date\n```\n\n## Multiple outputs\n\nIf you want more control over the output produced or to output the summary into multiple places (including stdout), just combine the result of htmlReport with other summary generators, as follows:\n\n```js\n// This will export to HTML as filename \"result.html\" AND also stdout using the text summary\nimport { htmlReport } from \"https://raw.githubusercontent.com/benc-uk/k6-reporter/main/dist/bundle.js\";\nimport { textSummary } from \"https://jslib.k6.io/k6-summary/0.0.1/index.js\";\n\nexport function handleSummary(data) {\n  return {\n    \"result.html\": htmlReport(data),\n    stdout: textSummary(data, { indent: \" \", enableColors: true }),\n  };\n}\n```\n\n# Screenshots\n\n![main report screenshot](https://user-images.githubusercontent.com/14982936/111346520-32b64100-8676-11eb-9b35-df32ef1982b1.png)\n\n![another report screenshot](https://user-images.githubusercontent.com/14982936/111085882-5d3ab980-8511-11eb-819d-d283bd03dc88.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenc-uk%2Fk6-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenc-uk%2Fk6-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenc-uk%2Fk6-reporter/lists"}