xk6_entry

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 2 Imported by: 0

README

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CounterModule

type CounterModule struct{}

func (*CounterModule) Get

func (m *CounterModule) Get() int

func (*CounterModule) Increment

func (m *CounterModule) Increment() int

func (*CounterModule) Reset

func (m *CounterModule) Reset()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL