promql.timestamp() 函数
promql.timestamp() 实现的功能相当于
PromQL 的 timestamp() 函数。
重要:internal/promql 包不适用于外部使用。
函数类型签名
(<-tables: stream[{A with _value: float}]) => stream[{A with _value: float}]
有关更多信息,请参见 Function type signatures。
参数
表格
输入数据。默认是管道转发的数据 (<-).
示例
将时间戳转换为自Unix纪元以来的秒数
import "internal/promql"
import "sampledata"
sampledata.float()
|> promql.timestamp()