【发布时间】:2021-10-06 06:17:43
【问题描述】:
我需要计算错误率,公式是countError/count
我已经尝试加入,但有点卡住了该做什么
count = from(bucket: "stress")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["application"] == "application name"
and r["_field"] == "count"
and r["transaction"] == "all")
|> sum(column: "_value")
countError = from(bucket: "stress")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["application"] == "application name"
and r["_field"] == "countError"
and r["transaction"] == "all")
|> sum(column: "_value")
join(
tables: {count,countError},
on: ["_value"]
)
【问题讨论】: