metrics

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package metrics mirrors the Prometheus surface emitted by benchmarking/locust/common/metrics.py — same metric names and labels so dashboards built against the Python locust workers keep working when the load source is a boomer-Go worker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecordFailure

func RecordFailure(method, name, userClass string, latency time.Duration, errMsg string)

RecordFailure reports a failed request to both boomer and Prometheus.

func RecordSuccess

func RecordSuccess(method, name, userClass string, latency time.Duration, responseBytes int64)

RecordSuccess reports a successful request to both boomer (→ locust master via ZMQ) and the local Prometheus surface.

func Serve

func Serve(ctx context.Context, addr string) error

Serve starts a /metrics HTTP server on addr. Returns when the server stops (or when ctx is cancelled, after which the server is gracefully shut down).

func UpdateUsers

func UpdateUsers(userClass string, delta float64)

UpdateUsers shifts the active-users gauge for a class by delta (positive on user start, negative on stop).

Types

This section is empty.

Jump to

Keyboard shortcuts

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