Skip to content

K6 extension designed to implement an atomic counter that supports multi-threaded and concurrent operations across Virtual Users (VUs).

License

Notifications You must be signed in to change notification settings

zagaris/xk6-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

K6 extension designed to implement an atomic counter that supports multi-threaded and concurrent operations across Virtual Users (VUs).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages