monitor.from() 函数
monitor.from()
检索存储在 _monitoring
bucket 的 statuses
measurement 中的检查状态。
函数类型签名
(
start: A,
?fn: (
r: {
B with
_value: C,
_time: time,
_stop: time,
_start: time,
_measurement: string,
_field: string,
},
) => bool,
?stop: D,
) => stream[E] where E: Record
有关更多信息,请参阅 函数类型签名。
参数
start
(必填) 结果中包含的最早时间。
使用相对持续时间、绝对时间或整数(Unix 时间戳,以秒为单位)。例如,-1h
、2019-08-28T22:00:00Z
或 1567029600
。持续时间是相对于 now()
的。
stop
结果中包含的最晚时间。默认为 now()
。
使用相对持续时间、绝对时间或整数(Unix 时间戳,以秒为单位)。例如,-1h
、2019-08-28T22:00:00Z
或 1567029600
。持续时间是相对于 now()
的
fn
评估为 true 或 false 的谓词函数。
评估为 true
的记录或行 (r
) 包含在输出表中。评估为空值或 false
的记录不包含在输出表中。
示例
查看过去一小时内的关键检查状态
import "influxdata/influxdb/monitor"
monitor.from(start: -1h, fn: (r) => r._level == "crit")
此页面是否对您有帮助?
感谢您的反馈!