1 Star 0 Fork 0

zhangjungang/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
config.go 810 Bytes
一键复制 编辑 原始数据 按行查看 历史
Andrew Kroh 提交于 2016-12-22 18:51 . Add system socket MetricSet
package socket
import "time"
// Config is the configuration specific to the socket MetricSet.
type Config struct {
ReverseLookup *ReverseLookupConfig `config:"socket.reverse_lookup"`
}
// ReverseLookupConfig contains the configuration that controls the reverse
// DNS lookup behavior.
type ReverseLookupConfig struct {
Enabled *bool `config:"enabled"`
SuccessTTL time.Duration `config:"success_ttl"`
FailureTTL time.Duration `config:"failure_ttl"`
}
// IsEnabled returns true if reverse_lookup is defined and 'enabled' is either
// not set or set to true.
func (c *ReverseLookupConfig) IsEnabled() bool {
return c != nil && (c.Enabled == nil || *c.Enabled)
}
const (
defSuccessTTL = 60 * time.Second
defFailureTTL = 60 * time.Second
)
var defaultConfig = Config{
ReverseLookup: nil,
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangjungang/beats.git
git@gitee.com:zhangjungang/beats.git
zhangjungang
beats
beats
v6.1.4

搜索帮助