temporal

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MIT Imports: 4 Imported by: 0

README

xk6-temporal

k6 extension for testing/benchmarking Temporal.

Note: This project is still a spike. The API may change at anytime as we learn from experience.

We recommend that you use this k6 extension to load test the temporal workflows where you can start your workflows and signalling to your existing workflows to pause/stop it.

Usage

This extension is available compiled into k6 as docker image for use in Docker or Kubernetes setups.

You can pull the latest image from: ghcr.io/temporalio/xk6-temporal:main.

Metrics

Currently the Temporal Client that the extension creates have their metrics wired into the k6 system. This has the benefit of being visible inside the k6 infrastructure for use in k6 checks and thresholds. The downside is that these metrics cannot be scraped into Prometheus to appear in the same way that SDK metrics normally would if exported from an application. This is because k6 adds a prefix to metrics and also handles histograms differently by pre-processing them into p95 and so on, as opposed to Temporal SDK's standard behaviour of sending them on to Prometheus as it's native histogram type. We are interested in feedback for what we might improve here.

Having said all that, if you do have Prometheus setup we recommend that you send the k6 metrics to your Prometheus instance to more easily tie k6 results to changes in Temporal metrics.

Note: Your prometheus instance will need to have remote write enabled for the metrics to be receieved, this is often not enabled by default.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModuleInstance

type ModuleInstance struct {
	// contains filtered or unexported fields
}

ModuleInstance represents an instance of the module for every VU.

func (*ModuleInstance) Exports

func (temporal *ModuleInstance) Exports() modules.Exports

Exports implements the modules.Instance interface and returns the exports of the JS module.

func (*ModuleInstance) NewClient

func (m *ModuleInstance) NewClient(options client.TemporalOptions) (*client.Client, error)

NewClient returns a new Temporal Client.

type RootModule

type RootModule struct{}

RootModule is the global module object type. It is instantiated once per test run and will be used to create `k6/x/temporal` module instances for each VU.

func (*RootModule) NewModuleInstance

func (*RootModule) NewModuleInstance(vu modules.VU) modules.Instance

NewModuleInstance implements the modules.Module interface to return a new instance for each VU.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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