buildmetrics

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser()

AddUser is invoked when a new simulated user is added. This then updates Prometheus metrics correlating to this (Users total | Active users)

func PullMetrics

func PullMetrics(ctx context.Context, metricsPort int, registeredActions []string) error

PullMetrics is called once to setup and enable Prometheus pull metrics on a certain endpoint

func PushMetrics

func PushMetrics(ctx context.Context, metricsTarget, job string, groupingKeys, registeredActions []string, enableApiMetrics bool) error

PushMetrics is called once to setup and enable Prometheus push metrics to specified address

func RemoveUser

func RemoveUser()

RemoveUser is invoked when a new simulated user is added. This then updates Prometheus metrics correlating to this (Decrements Active users). Note Total users is for obvious reasons not decremented

func ReportApiResult added in v0.6.25

func ReportApiResult(action, label, path, method string, responseCode int, duration time.Duration)

ReportApiResult reports the duration for a specific API path and response code

func ReportError

func ReportError(action string, label string)

ReportError is invoked when an error occurs in execution. A user action can in theory have many errors. This then updates Prometheus metrics correlating to this (Error counter)

func ReportFailure

func ReportFailure(action string, label string)

ReportFailure is invoked when a simulated user action fails. This then updates Prometheus metrics correlating to this (Failure counter for an action)

func ReportSuccess

func ReportSuccess(action string, label string, time float64)

ReportSuccess is invoked when a simulated user action is successfully completed. This then updates Prometheus metrics correlating to this (ReponseTimes | Latency | success counter for an action)

func ReportWarning

func ReportWarning(action string, label string)

ReportWarning is invoked when an warning occurs in execution. A user action can in theory have many warnings. This then updates Prometheus metrics correlating to this (Warning counter)

Types

This section is empty.

Jump to

Keyboard shortcuts

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