conveymetric

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const UnknownLabelValue = "unknown"

UnknownLabelValue is a constant for when key/tag can not be found in the C JSON.

Variables

This section is empty.

Functions

This section is empty.

Types

type Closure

type Closure func()

Closure will be returned after Update(), this should be used to update the struct, aka decrement the count.

type Interface

type Interface interface {
	// Update takes the convey JSON to update internal struct, and return a closure to update the struct again, or an
	// error
	//
	// Note: Closure should only be called once.
	Update(data convey.C, labelPairs ...string) (Closure, error)
}

Interface provides a way of updating an internal resource.

func NewConveyMetric

func NewConveyMetric(gauge metrics.Gauge, pairs ...TagLabelPair) Interface

NewConveyMetric produces an Interface where gauge is the internal structure to update, tag is the key in the C JSON to update the gauge, and label is the `key` for the gauge cardinality.

Note: The Gauge must have the label as one of the constant labels, (aka. the name of the gauge)

type TagLabelPair

type TagLabelPair struct {
	Tag   string
	Label string
}

TagLabelPair is a convenient structure for inputs to create a new convey metric.

Jump to

Keyboard shortcuts

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