MCPcopy
hub / github.com/prometheus/client_golang / valueFunc

Struct valueFunc

prometheus/value.go:64–71  ·  view source on GitHub ↗

valueFunc is a generic metric for simple values retrieved on collect time from a function. It implements Metric and Collector. Its effective type is determined by ValueType. This is a low-level building block used by the library to back the implementations of CounterFunc, GaugeFunc, and UntypedFunc.

Source from the content-addressed store, hash-verified

62// library to back the implementations of CounterFunc, GaugeFunc, and
63// UntypedFunc.
64type valueFunc struct {
65 selfCollector
66
67 desc *Desc
68 valType ValueType
69 function func() float64
70 labelPairs []*dto.LabelPair
71}
72
73// newValueFunc returns a newly allocated valueFunc with the given Desc and
74// ValueType. The value reported is determined by calling the given function

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected