0 Star 1 Fork 0

蒋佳李 / vault

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
text.go 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
蒋佳李 提交于 2021-03-25 16:28 . 更新
// Copyright 2016 Circonus, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package circonusgometrics
// A Text metric is an arbitrary string
//
// SetText sets a text metric
func (m *CirconusMetrics) SetText(metric string, val string) {
m.SetTextValue(metric, val)
}
// SetTextValue sets a text metric
func (m *CirconusMetrics) SetTextValue(metric string, val string) {
m.tm.Lock()
defer m.tm.Unlock()
m.text[metric] = val
}
// RemoveText removes a text metric
func (m *CirconusMetrics) RemoveText(metric string) {
m.tm.Lock()
defer m.tm.Unlock()
delete(m.text, metric)
}
// SetTextFunc sets a text metric to a function [called at flush interval]
func (m *CirconusMetrics) SetTextFunc(metric string, fn func() string) {
m.tfm.Lock()
defer m.tfm.Unlock()
m.textFuncs[metric] = fn
}
// RemoveTextFunc a text metric function
func (m *CirconusMetrics) RemoveTextFunc(metric string) {
m.tfm.Lock()
defer m.tfm.Unlock()
delete(m.textFuncs, metric)
}
Go
1
https://gitee.com/jiangjiali/vault.git
git@gitee.com:jiangjiali/vault.git
jiangjiali
vault
vault
v1.1.11

搜索帮助