噪声处理器插件
此插件用于向数值字段添加噪声。对于每个字段,使用定义的概率密度函数生成噪声并将其添加到值中。函数类型可以配置为拉普拉斯、高斯或均匀。
引入于: Telegraf v1.22.0 标签: transformation 操作系统支持: all
全局配置选项
插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md。
配置
# Adds noise to numerical fields
[[processors.noise]]
## Specified the type of the random distribution.
## Can be "laplacian", "gaussian" or "uniform".
# type = "laplacian
## Center of the distribution.
## Only used for Laplacian and Gaussian distributions.
# mu = 0.0
## Scale parameter for the Laplacian or Gaussian distribution
# scale = 1.0
## Upper and lower bound of the Uniform distribution
# min = -1.0
# max = 1.0
## Apply the noise only to numeric fields matching the filter criteria below.
## Excludes takes precedence over includes.
# include_fields = []
# exclude_fields = []根据选择的分布函数,必须设置相应的参数。默认设置为 noise_type = "laplacian" 且 mu = 0.0 和 scale = 1.0
使用 include_fields 和 exclude_fields 选项可以配置一个过滤器,仅将噪声应用于符合条件的数值字段。以下是可用的分布函数。
拉普拉斯分布 (Laplacian)
noise_type = laplacianscale: 也称为散布参数,调节函数的宽度和高度,更大的scale值意味着产生更大噪声的概率更高,默认设置为 1.0mu: 曲线的位置,默认设置为 0.0
高斯分布 (Gaussian)
noise_type = gaussianmu: 平均值,默认设置为 0.0scale: 标准差,默认设置为 1.0
均匀分布 (Uniform)
noise_type = uniformmin: 区间最小值,默认设置为 -1.0max: 区间最大值,默认设置为 1.0
示例
为 inputs.cpu 插件生成的每个值添加噪声,但不包括 usage_steal, usage_user, uptime_format, usage_idle 字段以及 swap, disk 和 net 指标的所有字段
[[inputs.cpu]]
percpu = true
totalcpu = true
collect_cpu_time = false
report_active = false
[[processors.noise]]
scale = 1.0
mu = 0.0
noise_type = "laplacian"
include_fields = []
exclude_fields = ["usage_steal", "usage_user", "uptime_format", "usage_idle" ]
namedrop = ["swap", "disk", "net"]向 cpu 指标添加噪声的结果
- cpu map[cpu:cpu11 host:98d5b8dbad1c] map[usage_guest:0 usage_guest_nice:0 usage_idle:94.3999999994412 usage_iowait:0 usage_irq:0.1999999999998181 usage_nice:0 usage_softirq:0.20000000000209184 usage_steal:0 usage_system:1.2000000000080036 usage_user:4.000000000014552]
+ cpu map[cpu:cpu11 host:98d5b8dbad1c] map[usage_guest:1.0078071583066057 usage_guest_nice:0.523063861602435 usage_idle:95.53920223476884 usage_iowait:0.5162661526251292 usage_irq:0.7138529816101375 usage_nice:0.6119678488887954 usage_softirq:0.5573585443688622 usage_steal:0.2006120911289802 usage_system:1.2954475820198437 usage_user:6.885664792615023]
此页面是否有帮助?
感谢您的反馈!
支持和反馈
感谢您成为我们社区的一员!我们欢迎并鼓励您对 Telegraf 和本文档提出反馈和 bug 报告。要获取支持,请使用以下资源
具有年度合同或支持合同的客户可以 联系 InfluxData 支持。