monitor.stateChanges() 函数
monitor.stateChanges()
检测包含 _level
列的数据流中的状态变化,并输出从 fromLevel
更改为 toLevel
的记录。
函数类型签名
(<-tables: stream[{C with _level: D}], ?fromLevel: A, ?toLevel: B) => stream[E] where A: Equatable, B: Equatable, D: Equatable, E: Record
更多信息,请参阅 函数类型签名。
参数
fromLevel
检测更改来源的级别。默认为 "any"
。
toLevel
检测更改目标的级别。默认为 "any"
。
tables
输入数据。默认为管道转发数据 (<-
)。
示例
检测状态何时更改为 critical
import "array"
import "influxdata/influxdb/monitor"
data =
array.from(
rows: [
{_time: 2021-01-01T00:00:00Z, _level: "ok"},
{_time: 2021-01-01T00:01:00Z, _level: "ok"},
{_time: 2021-01-01T00:02:00Z, _level: "warn"},
{_time: 2021-01-01T00:03:00Z, _level: "crit"},
],
)
data
|> monitor.stateChanges(toLevel: "crit")
此页内容对您有帮助吗?
感谢您的反馈!