我正在尝试使用 bosun 表达式添加 4 个系列。他们来自 1,2,3,4 周前。我将它们转移shift()
到当前时间。但我不能添加它们,因为它们有shift=1w
etc 标签。我怎样才能把这些系列加在一起?谢谢
编辑:这是 2 周的查询
$period = d("1w")
$duration = d("30m")
$week1end = tod(1 * $period )
$week1start = tod(1 * $period + $duration )
$week2end = tod(2 * $period )
$week2start = tod(2 * $period + $duration )
$q1 = q("avg:1m-avg:os.cpu{host=myhost}", $week1start, $week1end)
$q2 = q("avg:1m-avg:os.cpu{host=myhost}", $week2start, $week2end)
$shiftedq1 = shift($q1, "1w")
$shiftedq2 = shift($q2, "2w")
$shiftedq1+ $shiftedq2
问题类似于:如何添加over
查询输出中存在的系列:
over("avg:1m-avg:os.cpu{host=myhost}", "30m", "1w", 2)