博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CDPs PDPs RRAs RRDTools xff
阅读量:6207 次
发布时间:2019-06-21

本文共 4635 字,大约阅读时间需要 15 分钟。

RRA的配置格式如下 : 
RRA:AVERAGE | MIN | MAX | LAST:xff:steps:rows
压缩函数支持: 
AVERAGE | MIN | MAX | LAST
steps表示把多少个采样点(Primary Data Point 
PDP)压缩成一个压缩点(consolidated data point 
CDP)
rows表示保留多少个压缩点.
xff表示一次压缩区间允许有多少比例的未知的PDP, 超过比例的话对应的CDP也称为未知.

截取自man rrdcreate
RRA:CF:cf arguments       The purpose of an RRD is to store data in the round robin archives (RRA). An archive consists of a number of       data values or statistics for each of the defined data-sources (DS) and is defined with an RRA line.       When data is entered into an RRD, it is first fit into time slots of the length defined with the -s option,       thus becoming a primary data point.       The data is also processed with the consolidation function (CF) of the archive. There are several consolidation       functions that consolidate primary data points via an aggregate function: AVERAGE, MIN, MAX, LAST.       AVERAGE           the average of the data points is stored.       MIN the smallest of the data points is stored.       MAX the largest of the data points is stored.       LAST           the last data points is used.       Note that data aggregation inevitably leads to loss of precision and information. The trick is to pick the       aggregate function such that the interesting properties of your data is kept across the aggregation process.       The format of RRA line for these consolidation functions is:       RRA:AVERAGE | MIN | MAX | LAST:xff:steps:rows       xff The xfiles factor defines what part of a consolidation interval may be made up from *UNKNOWN* data while       the consolidated value is still regarded as known. It is given as the ratio of allowed *UNKNOWN* PDPs to the       number of PDPs in the interval. Thus, it ranges from 0 to 1 (exclusive).       steps defines how many of these primary data points are used to build a consolidated data point which then goes       into the archive.       rows defines how many generations of data values are kept in an RRA.  Obviously, this has to be greater than       zero.
rrd-beginners的例子讲得比较清晰 : 
截取自man rrd-beginners
rrdtool create target.rrd \                --start 1023654125 \                --step 300 \                DS:mem:GAUGE:600:0:671744 \                RRA:AVERAGE:0.5:12:24 \                RRA:AVERAGE:0.5:288:31       The next line declares a round robin archive (RRA). The syntax for declaring an RRA is        RRA:CF:xff:step:rows       RRA is the keyword to declare RRAs. The consolidation function (CF) can be AVERAGE, MINIMUM, MAXIMUM, and LAST.       The concept of the consolidated data point (CDP) comes into the picture here. A CDP is CFed (averaged,       maximum/minimum value or last value) from step number of PDPs. This RRA will hold rows CDPs.       Lets have a look at the example above. For the first RRA, 12 (steps) PDPs (DS variables) are AVERAGEed (CF) to       form one CDP. 24 (rows) of theses CDPs are archived. Each PDP occurs at 300 seconds. 12 PDPs represent 12 times       300 seconds which is 1 hour. It means 1 CDP (which is equal to 12 PDPs) represents data worth 1 hour. 24 such       CDPs represent 1 day (1 hour times 24 CDPs). This means, this RRA is an archive for one day. After 24 CDPs, CDP       number 25 will replace the 1st CDP. The second RRA saves 31 CDPs; each CPD represents an AVERAGE value for a       day (288 PDPs, each covering 300 seconds = 24 hours). Therefore this RRA is an archive for one month. A single       database can have many RRAs. If there are multiple DSs, each individual RRA will save data for all the DSs in       the database. For example, if a database has 3 DSs and daily, weekly, monthly, and yearly RRAs are declared,       then each RRA will hold data from all 3 data sources.
[参考]
1. man rrd-beginners
2. man rrdcreate
3. 
一直对 rrdtool 在 create 时 RRA 中的 xff 参数的意义不是很清楚,今天 仔细研究了一下,做个总结。下面是 man rrdcreate 里的说明:
RRA:AVERAGE | MIN | MAX | LAST:xff:steps:rows
xff The xfiles factor defines what part of a consolidation interval may be made up from *UNKNOWN* data while the consolidated value is still regarded as known. It is given as the ratio of allowed *UNKNOWN* PDPs to the number of PDPs in the interval. Thus, it ranges from 0 to 1 (exclusive).
xff 决定在给定间隔中可以有多大比例的未知 PDP,超过这个比例则该间隔内的值 为 UNKNOWN,其取值范围为前闭后开区间,即: [0, 1) 。举两个极端的例子:
xff = 0 表示不能有未知 PDP
xff = 0.9 表示可以有 90% 的 未知PDP
下面是测试的程序(备忘)。
 1 #!/bin/sh
 2 
 3 LANG=C
 4 
 5 xff=0.5
 6 
 7 #t=$(date +%s)
 8 t=1480272727
 9 
10 echo $(date), $t
11 
12 rrdtool create test.rrd -b $(date +%s) --step 1 DS:temp:GAUGE:1:0:100 RRA:AVERAGE:${xff}:5:10
13 for i in `seq 1 20`; do
14     rrdtool update test.rrd ${t}:${i}
15     t=$((t + 1))
16 done
17 
18 rrdtool dump test.rrd

转载地址:http://qehca.baihongyu.com/

你可能感兴趣的文章
计划备份mysql数据库
查看>>
Tcp_wrapper
查看>>
Unity3D项目开发一点经验
查看>>
Oracle Study之--Oracle等待事件(5)
查看>>
Lync Server 2013无法共享PPT故障排错处理
查看>>
Citrix、Microsoft、VMware虚拟桌面之网页接口登录对比
查看>>
华为产品技术学习笔记之路由原理(一)
查看>>
RedHat5.2下Linux Oracle 10g ASM 安装详细实录-第二篇-ASM安装
查看>>
[转]Android笔记:ScrollView嵌套ViewPager的滚动冲突解决方法
查看>>
乱花渐欲迷人眼-杜绝设计的视噪
查看>>
JAVA 网络编程小记
查看>>
JPDA 架构研究5 - Agent利用环境指针访问VM (内存管理篇)
查看>>
获取Extjs文本域中的内容
查看>>
RHEL 5基础篇—常见系统启动类故障
查看>>
Exchange 2010无法安装问题解决方法
查看>>
(马世龙)Linux下CACTI完全搭建技术文档二
查看>>
mySQL教程 第9章 触发器
查看>>
IBM量子计算新突破:成功构建50个量子比特原型机
查看>>
Linux-RHEL5-初学者配置vsftpd注意事项
查看>>
“Unamed VM”无法初始化 0x80070539
查看>>