Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 537 Bytes

README.md

File metadata and controls

32 lines (22 loc) · 537 Bytes

xk6-counter

A k6 extension that provides a simple, thread-safe global counter. Counter is shared across all Virtual Users (VUs) in a K6 test.

import counter from 'k6/x/counter';

export default function () {
  counter.increment();

  console.log(`Counter value: ${counter.Get()}`);
}

Build

1. Install xk6

go install go.k6.io/xk6/cmd/xk6@latest

2. Build K6 binary

xk6 build --with github.com/zagaris/xk6-counter@latest

3. Run test

./k6 run atomic.test.js