Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dgzlopes/xk6-say
A k6 extension to say hello.
https://github.com/dgzlopes/xk6-say
k6 k6-extension xk6
Last synced: about 2 months ago
JSON representation
A k6 extension to say hello.
- Host: GitHub
- URL: https://github.com/dgzlopes/xk6-say
- Owner: dgzlopes
- License: apache-2.0
- Created: 2020-11-16T11:25:52.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-07T15:12:01.000Z (about 3 years ago)
- Last Synced: 2024-10-24T13:58:34.505Z (about 2 months ago)
- Topics: k6, k6-extension, xk6
- Language: Go
- Homepage:
- Size: 58.6 KB
- Stars: 6
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xk6-say
This is a [k6](https://go.k6.io/k6) extension using the
[xk6](https://github.com/grafana/xk6) system.| :exclamation: This is a proof of concept, isn't supported by the k6 team, and may break in the future. USE AT YOUR OWN RISK! |
|------|## Build
To build a `k6` binary with this extension, first ensure you have the prerequisites:
- [Go toolchain](https://go101.org/article/go-toolchain.html)
- GitThen:
1. Install `xk6`:
```shell
$ go install go.k6.io/xk6/cmd/xk6@latest
```2. Build the binary:
```shell
$ xk6 build --with github.com/dgzlopes/xk6-say@latest
```## Example
```javascript
// script.js
import say from 'k6/x/say';export default function () {
console.log(say.hello("Daniel"));
}
```Result output:
```
$ ./k6 run script.js
/\ |‾‾| /‾‾/ /‾‾/
/\ / \ | |/ / / /
/ \/ \ | ( / ‾‾\
/ \ | |\ \ | (‾) |
/ __________ \ |__| \__\ \_____/ .ioexecution: local
script: ../example.js
output: -scenarios: (100.00%) 1 scenario, 1 max VUs, 10m30s max duration (incl. graceful stop):
* default: 1 iterations for each of 1 VUs (maxDuration: 10m0s, gracefulStop: 30s)INFO[0000] Hello Daniel source=console
running (00m00.0s), 0/1 VUs, 1 complete and 0 interrupted iterations
default ✓ [======================================] 1 VUs 00m00.0s/10m0s 1/1 iters, 1 per VUdata_received........: 0 B 0 B/s
data_sent............: 0 B 0 B/s
iteration_duration...: avg=72.55µs min=72.55µs med=72.55µs max=72.55µs p(90)=72.55µs p(95)=72.55µs
iterations...........: 1 73.974827/s
```