1 Star 0 Fork 0

zhangjungang/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
config.go 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
package process
import "github.com/elastic/beats/libbeat/common/cfgwarn"
// includeTopConfig is the configuration for the "top N processes
// filtering" feature
type includeTopConfig struct {
Enabled bool `config:"enabled"`
ByCPU int `config:"by_cpu"`
ByMemory int `config:"by_memory"`
}
type Config struct {
Procs []string `config:"processes"`
Cgroups *bool `config:"process.cgroups.enabled"`
EnvWhitelist []string `config:"process.env.whitelist"`
CacheCmdLine bool `config:"process.cmdline.cache.enabled"`
IncludeTop includeTopConfig `config:"process.include_top_n"`
IncludeCPUTicks bool `config:"process.include_cpu_ticks"`
CPUTicks *bool `config:"cpu_ticks"` // Deprecated
}
func (c Config) Validate() error {
if c.CPUTicks != nil {
cfgwarn.Deprecate("6.1", "cpu_ticks is deprecated. Use process.include_cpu_ticks instead")
}
return nil
}
var defaultConfig = Config{
Procs: []string{".*"}, // collect all processes by default
CacheCmdLine: true,
IncludeTop: includeTopConfig{
Enabled: true,
ByCPU: 0,
ByMemory: 0,
},
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangjungang/beats.git
git@gitee.com:zhangjungang/beats.git
zhangjungang
beats
beats
v6.1.0

搜索帮助