当前位置: 首页 > news >正文

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

相关文章:

  • 多线程基础篇(3)——初试锁
  • java获取文件列表,并按照目录的深度及文件名的拼音的升序排列
  • 爬虫大作业
  • 散列表解决冲突的办法
  • 访谈:摩尔定律后时代,看13位行业专家如何看量子计算机的未来?
  • 青云QingCloud黄允松:关于云计算未来的三个预测
  • slim.flatten——将输入扁平化但保留batch_size,假设第一维是batch
  • 深入浅出MyBatis:MyBatis插件及开发过程
  • 解决Mybatis配置ORM映射 时分秒都为0
  • Spring Cloud入门教程-Hystrix断路器实现容错和降级
  • 0505 php-数组、控制语句、函数
  • 第三期 行为规划——6.输出状态转换方程的量
  • Ping程序
  • 群发功能推广通知短信的一些问题
  • 蓝海存储开关机注意事项总结
  • hexo+github搭建个人博客
  • #Java异常处理
  • cookie和session
  • CSS中外联样式表代表的含义
  • ECMAScript 6 学习之路 ( 四 ) String 字符串扩展
  • E-HPC支持多队列管理和自动伸缩
  • isset在php5.6-和php7.0+的一些差异
  • rabbitmq延迟消息示例
  • React的组件模式
  • redis学习笔记(三):列表、集合、有序集合
  • Spark学习笔记之相关记录
  • 高程读书笔记 第六章 面向对象程序设计
  • 基于OpenResty的Lua Web框架lor0.0.2预览版发布
  • 模仿 Go Sort 排序接口实现的自定义排序
  • 深度学习在携程攻略社区的应用
  • 微服务入门【系列视频课程】
  • 在 Chrome DevTools 中调试 JavaScript 入门
  • 阿里云API、SDK和CLI应用实践方案
  • ​io --- 处理流的核心工具​
  • ![CDATA[ ]] 是什么东东
  • #我与Java虚拟机的故事#连载19:等我技术变强了,我会去看你的 ​
  • (2)(2.10) LTM telemetry
  • (java版)排序算法----【冒泡,选择,插入,希尔,快速排序,归并排序,基数排序】超详细~~
  • (Mac上)使用Python进行matplotlib 画图时,中文显示不出来
  • (亲测有效)解决windows11无法使用1500000波特率的问题
  • (三)模仿学习-Action数据的模仿
  • (生成器)yield与(迭代器)generator
  • (十三)Java springcloud B2B2C o2o多用户商城 springcloud架构 - SSO单点登录之OAuth2.0 根据token获取用户信息(4)...
  • (算法)求1到1亿间的质数或素数
  • (转) 深度模型优化性能 调参
  • (转)JVM内存分配 -Xms128m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=512m
  • (转)Linux整合apache和tomcat构建Web服务器
  • (转)nsfocus-绿盟科技笔试题目
  • (转)Sql Server 保留几位小数的两种做法
  • (转)Windows2003安全设置/维护
  • (转)甲方乙方——赵民谈找工作
  • (转)平衡树
  • .CSS-hover 的解释
  • .htaccess配置常用技巧
  • .Net Framework 4.x 程序到底运行在哪个 CLR 版本之上