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.
| 62 | // library to back the implementations of CounterFunc, GaugeFunc, and |
| 63 | // UntypedFunc. |
| 64 | type 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 |
nothing calls this directly
no outgoing calls
no test coverage detected