【问题标题】:aggregateWindow aligned to specified timezone与指定时区对齐的聚合窗口
【发布时间】:2021-05-19 08:10:11
【问题描述】:

使用 Influxdb 的 Flux 语言给出以下查询:

from(bucket: "some-great-metrics")
   |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
   |> aggregateWindow(every: 1mo, fn: sum)
   |> yield() 

假设我当前的时区是PST。如何确保aggregateWindow 在此特定时区(PST)中尊重1mo 持续时间的开始和结束?

到目前为止,在documentation 中搜索并没有给我带来太多启示。

【问题讨论】:

标签: timezone influxdb flux timezone-offset


【解决方案1】:

似乎 Influx 2.1 带有一个新的Flux timezone package

您可以尝试升级到 2.1 并在查询前添加:

import "timezone"

option location = timezone.location(name: "America/Los_Angeles")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-05
    • 1970-01-01
    • 2019-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-13
    相关资源
    最近更新 更多