go1.20.5
GoThrough

metrics.KindBad

// KindBad indicates that the Value has no type and should not be used. const KindBad = iota

metrics.KindFloat64

// KindFloat64 indicates that the type of the Value is a float64. const KindFloat64 = iota

metrics.KindFloat64Histogram

// KindFloat64Histogram indicates that the type of the Value is a *Float64Histogram. const KindFloat64Histogram = iota

metrics.KindUint64

// KindUint64 indicates that the type of the Value is a uint64. const KindUint64 = iota

metrics.All

// All returns a slice of containing metric descriptions for all supported metrics. func All() []Description

metrics.Read

// Read populates each Value field in the given slice of metric samples. // // Desired metrics should be present in the slice with the appropriate name. // The user of this API is encouraged to re-use the same slice between calls for // efficiency, but is not required to do so. // // Note that re-use has some caveats. Notably, Values should not be read or // manipulated while a Read with that value is outstanding; that is a data race. // This property includes pointer-typed Values (for example, Float64Histogram) // whose underlying storage will be reused by Read when possible. To safely use // such values in a concurrent setting, all data must be deep-copied. // // It is safe to execute multiple Read calls concurrently, but their arguments // must share no underlying memory. When in doubt, create a new []Sample from // scratch, which is always safe, though may be inefficient. // // Sample values with names not appearing in All will have their Value populated // as KindBad to indicate that the name is unknown. func Read(m []Sample)