Derivative Aggregator 插件
此插件计算聚合指标的所有字段的导数。
引入于: Telegraf v1.18.0 标签: math 操作系统支持: all
全局配置选项
插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md。
配置
# Calculates a derivative for every field.
[[aggregators.derivative]]
## The period in which to flush the aggregator.
# period = "30s"
## Suffix to append for the resulting derivative field.
# suffix = "_rate"
## Field to use for the quotient when computing the derivative.
## When using a field as the derivation parameter the name of that field will
## be used for the resulting derivative, e.g. *fieldname_by_parameter*.
## By default the timestamps of the metrics are used and the suffix is omitted.
# variable = ""
## Maximum number of roll-overs in case only one measurement is found during a period.
# max_roll_over = 10此聚合器将估算指标每个字段的导数,该指标包含在聚合区间的第一个和最后一个指标中。如果未进行进一步配置,则导数将相对于这两个测量值之间以秒为单位的时间差进行计算。对于每个字段都应用以下公式
derivative = (value_last - value_first) / (time_last - time_first)如果未配置 suffix,则生成的导数将命名为 <fieldname>_rate。
要计算每个字段的导数,请使用
[[aggregators.derivative]]
## Specific Derivative Aggregator Arguments:
## Configure a custom derivation variable. Timestamp is used if none is given.
# variable = ""
## Suffix to add to the field name for the derivative name.
# suffix = "_rate"
## Roll-Over last measurement to first measurement of next period
# max_roll_over = 10
## General Aggregator Arguments:
## calculate derivative every 30 seconds
period = "30s"时间导数
在其默认配置中,它确定周期内第一个和最后一个测量值。从这些测量值中计算出以秒为单位的时间差。然后,使用以下公式将此时间差用于除以每个字段的差值
derivative = (value_last - value_first) / (time_last - time_first)对于每个字段,导数都以命名模式 <fieldname>_rate 发出。
自定义推导变量
该插件支持使用聚合测量值的字段作为分母中的推导变量。假定此变量是单调递增的值。在此功能中,使用以下公式
derivative = (value_last - value_first) / (variable_last - variable_first)确保指定的变量未被过滤,并且存在于传递给此聚合器的指标中!
使用自定义推导变量时,应更改导数名称的 suffix。请参阅下一节关于自定义导数名称 | | 16 | 4.0 | | | | | | 18 | 2.0 | | | | | | 20 | 0.0 | | | | | ||| -1.0 | -1.0 | | |
差异源于周期之间值的变化,例如,从第一个周期到第二个周期从 6.0 变为 8.0。使用 max_roll_over = 0 时会忽略这些变化,但使用 max_roll_over = 1 时会考虑。计算出的导数没有更多差异是由于示例数据,该数据在第一个和最后一个周期内具有恒定的导数,即使包含周期之间的间隔。如果需要检测周期之间的变化,例如当一个周期内的测量值非常少或准恒定指标只有偶尔变化时,使用大于 0 的 max_roll_over 值可能很重要。
标签
此聚合器不应用任何标签。现有的标签将保持不变地通过聚合器。
示例输出
net bytes_recv=15409i,packets_recv=164i,bytes_sent=16649i,packets_sent=120i 1508843640000000000
net bytes_recv=73987i,packets_recv=364i,bytes_sent=87328i,packets_sent=452i 1508843660000000000
net bytes_recv_by_packets_recv=292.89 1508843660000000000
net packets_sent_rate=16.6,bytes_sent_rate=3533.95 1508843660000000000
net bytes_sent_by_packet=292.89 1508843660000000000此页面是否有帮助?
感谢您的反馈!
支持和反馈
感谢您成为我们社区的一员!我们欢迎并鼓励您对 Telegraf 和本文档提出反馈和 bug 报告。要获取支持,请使用以下资源
具有年度合同或支持合同的客户可以 联系 InfluxData 支持。