metrics

package
v0.0.0-...-c624722 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package metrics provides support to update metric values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Goroutines *metrics.Gauge[uint64]
	Requests   *metrics.Counter[uint64]
	Failures   *metrics.Counter[uint64]
	Panics     *metrics.Counter[uint64]
}

Config lists the set of metrics that is tracked.

type Values

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

Values provides an api to work with metrics.

func New

func New(cfg Config) *Values

New constructs a Values for working with metrics.

func (*Values) IncFailures

func (v *Values) IncFailures()

IncFailures increments the failures by 1.

func (*Values) IncPanics

func (v *Values) IncPanics()

IncPanics increments the panics by 1.

func (*Values) IncRequests

func (v *Values) IncRequests() int64

IncRequests increments the requests by 1.

func (*Values) SetGoroutines

func (v *Values) SetGoroutines()

SetGoroutines updates the number of goroutines.

Jump to

Keyboard shortcuts

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