Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vvarp/xk6-wamp
A k6 extension that adds support for WAMP protocol.
https://github.com/vvarp/xk6-wamp
k6 k6-extension xk6
Last synced: 4 months ago
JSON representation
A k6 extension that adds support for WAMP protocol.
- Host: GitHub
- URL: https://github.com/vvarp/xk6-wamp
- Owner: vvarp
- Created: 2021-04-19T18:54:53.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-25T21:35:29.000Z (over 3 years ago)
- Last Synced: 2024-07-30T21:05:38.877Z (6 months ago)
- Topics: k6, k6-extension, xk6
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# xk6-wamp
This is a [WAMP protocol](https://wamp-proto.org) client library for [k6](https://go.k6.io/k6),
implemented as an extension using the [xk6](https://github.com/grafana/xk6) system.It is based on [nexus WAMP client library](https://github.com/gammazero/nexus).
| :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
make build
```## Example test script
```javascript
import wamp from 'k6/x/wamp';
import { sleep } from 'k6';export default function () {
const client = new wamp.Client(
"ws://127.0.0.1:9000",
{
realm: "default",
}
);const subId = client.subscribe("test", {}, function (args, kwargs) {
console.log(args, kwargs)
});const sessId = client.getSessionID();
console.log(`Subscription ID: ${sessId} ${subId}`)sleep(Math.random() * 2);
client.disconnect()
}
```