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

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Prometheus Querying Function rate() vs irate()

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

rate()

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

rate()函數(shù)計(jì)算某個(gè)時(shí)間序列范圍內(nèi)的每秒平均增長(zhǎng)率

?

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

自適應(yīng)單調(diào)性中斷(比如target重啟導(dǎo)致的計(jì)數(shù)器重置)。

?

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.

計(jì)算結(jié)果是推算到每個(gè)時(shí)間范圍的最后而得出,允許漏抓和抓取周期與時(shí)間范圍的不完美結(jié)合。

?

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請(qǐng)求每秒增長(zhǎng)率

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應(yīng)該只和計(jì)數(shù)器一起使用。最適合告警和緩慢計(jì)數(shù)器的繪圖。

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()函數(shù)計(jì)算一段時(shí)間范圍內(nèi)某個(gè)時(shí)刻的每秒增長(zhǎng)率

?

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

基于最后兩個(gè)數(shù)據(jù)點(diǎn)進(jìn)行計(jì)算。自適應(yīng)單調(diào)性中斷(比如target重啟導(dǎo)致的計(jì)數(shù)器重置)。

?

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:

以下示例返回五分鐘內(nèi)最近兩次數(shù)據(jù)點(diǎn)的HTTP請(qǐng)求每秒增長(zhǎng)率

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應(yīng)該只和快速的、不穩(wěn)定的計(jì)數(shù)器一起使用。

?

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

因?yàn)楸嚷识虝旱母淖兛梢猿渲礔OR語句,而且一個(gè)包含極少的峰(突然上升)的圖是很難閱讀的。

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.

轉(zhuǎn)載于:https://www.cnblogs.com/jugglee/p/8963743.html

總結(jié)

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

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。