mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-25 03:40:10 +01:00
40 lines
633 B
Go
40 lines
633 B
Go
|
package main
|
||
|
|
||
|
import "github.com/VictoriaMetrics/metrics"
|
||
|
|
||
|
type gauge struct {
|
||
|
name string
|
||
|
*metrics.Gauge
|
||
|
}
|
||
|
|
||
|
func getOrCreateGauge(name string, f func() float64) *gauge {
|
||
|
return &gauge{
|
||
|
name: name,
|
||
|
Gauge: metrics.GetOrCreateGauge(name, f),
|
||
|
}
|
||
|
}
|
||
|
|
||
|
type counter struct {
|
||
|
name string
|
||
|
*metrics.Counter
|
||
|
}
|
||
|
|
||
|
func getOrCreateCounter(name string) *counter {
|
||
|
return &counter{
|
||
|
name: name,
|
||
|
Counter: metrics.GetOrCreateCounter(name),
|
||
|
}
|
||
|
}
|
||
|
|
||
|
type summary struct {
|
||
|
name string
|
||
|
*metrics.Summary
|
||
|
}
|
||
|
|
||
|
func getOrCreateSummary(name string) *summary {
|
||
|
return &summary{
|
||
|
name: name,
|
||
|
Summary: metrics.GetOrCreateSummary(name),
|
||
|
}
|
||
|
}
|