简体   繁体   English

如何在 Grafana 中绘制值的倒数?

[英]How can I plot the reciprocal of a value in Grafana?

How can I plot the 1/series in Grafana?如何在 Grafana 中绘制1/series The docs show scale , which allows multiplying by a constant, and divideSeries which allows you to divide two series by each other, but there doesn't seem to be a way to divide a constant by a series. 文档显示scale ,它允许乘以一个常数, divideSeries允许您将两个系列相互除,但似乎没有办法将常数除以系列。

一个简单的解决方法是添加第二个查询 constantLine(1),然后添加第三个查询,将第二个查询除以第一个,然后隐藏前两个查询,您应该很好地使用第三个查询。

Grafana supports the invert function, as described in the docs . Grafana 支持invert函数,如文档中所述。

"Takes one metric or a wildcard seriesList, and inverts each datapoint (ie 1/x)." “采用一个指标或通配符 seriesList,并反转每个数据点(即 1/x)。”

This is the example from the documentation:这是文档中的示例:

&target=invert(Server.instance01.threads.busy)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM