日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Prometheus Querying Function rate() vs irate()

發布時間:2023/12/20 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Prometheus Querying Function rate() vs irate() 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

rate()

rate(v range-vector)?calculates the per-second average rate of increase of the time series in the range vector.

rate()函數計算某個時間序列范圍內的每秒平均增長率

?

Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for.

自適應單調性中斷(比如target重啟導致的計數器重置)。

?

Also, the calculation extrapolates to the ends of the time range, allowing for missed scrapes or imperfect alignment of scrape cycles with the range's time period.

計算結果是推算到每個時間范圍的最后而得出,允許漏抓和抓取周期與時間范圍的不完美結合。

?

The following example expression returns the per-second rate of HTTP requests as measured over the last 5 minutes, per time series in the range vector:

以下示例返回最后五分鐘HTTP請求每秒增長率

rate(http_requests_total{job="api-server"}[5m])

rate?should only be used with counters. It is best suited for alerting, and for graphing of slow-moving counters.

rate應該只和計數器一起使用。最適合告警和緩慢計數器的繪圖。

Note that when combining?rate()?with an aggregation operator (e.g.?sum()) or a function aggregating over time (any function ending in?_over_time), always take a?rate()?first, then aggregate. Otherwise?rate()?cannot detect counter resets when your target restarts.

irate()

irate(v range-vector)?calculates the per-second instant rate of increase of the time series in the range vector.

irate()函數計算一段時間范圍內某個時刻的每秒增長率

?

This is based on the last two data points. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for.

基于最后兩個數據點進行計算。自適應單調性中斷(比如target重啟導致的計數器重置)。

?

The following example expression returns the per-second rate of HTTP requests looking up to 5 minutes back for the two most recent data points, per time series in the range vector:

以下示例返回五分鐘內最近兩次數據點的HTTP請求每秒增長率

irate(http_requests_total{job="api-server"}[5m])

irate?should only be used when graphing volatile, fast-moving counters. Use?rate?for alerts and slow-moving counters,

rate應該只和快速的、不穩定的計數器一起使用。

?

as brief changes in the rate can reset the?FOR?clause and graphs consisting entirely of rare spikes are hard to read.

因為比率短暫的改變可以充值FOR語句,而且一個包含極少的峰(突然上升)的圖是很難閱讀的。

Note that when combining?irate()?with an?aggregation operator?(e.g.?sum()) or a function aggregating over time (any function ending in?_over_time), always take a?irate()?first, then aggregate.

Otherwise?irate()?cannot detect counter resets when your target restarts.

轉載于:https://www.cnblogs.com/jugglee/p/8963743.html

總結

以上是生活随笔為你收集整理的Prometheus Querying Function rate() vs irate()的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。