简体   繁体   English

在 Prometheus PromQL 中获取最后一小时的平均费率

[英]Get average rate for the last one hour in Prometheus PromQL

I am trying to get the average rate of request for the last one hour.我正在尝试获取过去一小时的平均请求率。

I am using the following query to get the rate我正在使用以下查询来获取费率

sum(rate(query_executes{ namespace ='oracle'}[1m]) by (database) sum(rate(query_executes{ namespace ='oracle'}[1m]) by (database)

But if I were to get the average of the above rate for the last one hour, how do I do that?但是,如果我要获得过去一小时上述费率的平均值,我该怎么做呢?

Rates are fundamentally averages, if you would like to calculate "average(rate(some_metric[1m])[1h])" just execute "rate(some_metric[1h])".费率基本上是平均值,如果您想计算“平均值(速率(some_metric [1m])[1h])”,只需执行“速率(some_metric [1h])”。

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

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