mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
metrics: add SetInt64 to ease using LabelMap for gauge metrics
Set is provided by the underlying Map. Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
parent
1ba0b7fd79
commit
a7eab788e4
@ -33,6 +33,11 @@ type LabelMap struct {
|
|||||||
expvar.Map
|
expvar.Map
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetInt64 sets the *Int value stored under the given map key.
|
||||||
|
func (m *LabelMap) SetInt64(key string, v int64) {
|
||||||
|
m.Get(key).Set(v)
|
||||||
|
}
|
||||||
|
|
||||||
// Get returns a direct pointer to the expvar.Int for key, creating it
|
// Get returns a direct pointer to the expvar.Int for key, creating it
|
||||||
// if necessary.
|
// if necessary.
|
||||||
func (m *LabelMap) Get(key string) *expvar.Int {
|
func (m *LabelMap) Get(key string) *expvar.Int {
|
||||||
|
Loading…
Reference in New Issue
Block a user