CDPs PDPs RRAs RRDTools xff

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. http://blog.clanzx.net/2010/07/16/rrdtool.html

一直对 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

时间: 2024-12-11 15:49:08

CDPs PDPs RRAs RRDTools xff的相关文章

Windows server 2003 RRAS实现单网卡VPN代理上网

Windows server 2003的RRAS支持单网卡VPN功能,它的部署也很简单. 一.启用RRAS. 在windows server2003的administrative tools打开RRAS,并启用它. 如果你的系统没有关闭"windows firewall and internet connection sharing"服务没有关闭,在点击"配置和启用路由和远程访问"的时候会提示你要关闭它才能继续. 因为是单网卡,所以在接下来的步骤里要选择自定义配置.

hyper v-双线托管Windows Server 2008 R2用RRAS做NAT的问题

问题描述 双线托管Windows Server 2008 R2用RRAS做NAT的问题 我有一台Windows Server 2008 R2的服务器,托管到电信联通双线机房里,两IP分别是203.x.x.x和211.x.x.x 使用Hyper-V建虚拟机,虚拟交换机IP设为10.0.100.1,4个虚拟主机分别是10.0.100.100~10.0.100.103 我安装了RRAS服务,做端口映射,我把203.x.x.x映射到虚拟交换机上,但是问题出现了,非但端口没有正常转发,反而连203.x.x

gmetad configure

gmetad的用途是从gmond接收metric统计信息, 并将统计信息存入rrdtools数据文件. 或者将接收到的metric forward给外部系统, 如Graphite. 同时gmetad还支持在gmetad之间传输XML dump数据, 组成一个大的监控系统. gmetad还提供interactivei请求, 例如gweb使用interactive向gmetad请求不能再rrd文件中描述的信息. 基本的架构图如下, gmetad从gmond获取metric信息, 一个cluster只

《ELK Stack权威指南 》第2章 插件配置

本节书摘来自华章出版社<ELK Stack权威指南 >一书中的第1章,第2节,作者饶琛琳,更多章节内容可以访问"华章计算机"公众号查看. 插 件 配 置 插件是Logstash最大的特色.各种不同的插件源源不断地被创造出来,发布到社区中供大家使用.本章会按照插件的类别,对一般场景下的一些常用插件做详细的配置和用例介绍.本章介绍的插件包括:1)输入插件.基于shipper端场景,主要介绍STDIN.TCP.File等插件.2)编解码插件.编解码通常是会被遗忘的环节,但是运用好

oracle:ASM简单管理

一.ASM磁盘和磁盘组管理 1.创建磁盘组 create diskgroup DG2 EXTERNAL REDUNDANCY DISK 'ORCL:A1′; Note:1)磁盘名称需要大写 2)磁盘名称使用V$asm_disk.path 2.磁盘组中添加磁盘 alter diskgroup dg2 add disk 'ORCL:A2′; Note:磁盘名称使用V$asm_disk.path 3.磁盘组中删除磁盘 alter diskgroup dg2 drop disk 'a1′; Note:磁

php socket 处理不过来数据流,该如何避免(好像是阻塞了)

php socket 处理不过来数据流,该如何处理(好像是阻塞了) 需求:php接受一个硬件往8888端口上发送数据,如果收到后,应socket_send函数返回"\xFA\x01\x01\xFF\xAA\xAA\x00\x01\x00\x00\x00\x00\x00\x01",硬件再接收到socket_send发送的数据后,会"滴"一声,但是问题出现了,一个硬件还好,但是当多个硬件同时连接并同时发送数据时,会出现硬件不能连续的回应(即发出"滴"

SQL Server DT问与答

server Q: 假设我现在有2台SQL Server (Windows Server 2003 + SQL Server 200 sp3),分别叫DB01和DB02,互相信任,互相把对方加入了Linked Servers的列表,常规访问无任何问题,但是无法启用分布式事务,例子如下: 在DB01上运行下列SQL命令: begin tran select top 1 * from item select top 1 * from db02.production.dbo.item rollback

内网FTP服务器架设不完全解析

ftp服务器 首先要提到的是这里的内网是指一般我们网吧内部环境的内网,对局域网内网我没什么好说的,愿花钱的去DNS0755好了.一个基本条件:一个公网IP,对网关有操作权限. FTP服务器端192.168.0.100,我选用Win2K+Serv-U 4.1.0.0,很普通常用的一个组合网关是最简单的双网卡PC,一接外网一接内网,这里假设外网IP为218.4.218.4,内网IP为192.168.0.1. 提一些概念性的东东: 一次完整的FTP会话,包含有两个连接,一个称之为命令通道,一个称之为数

浅谈 PHP 变量可用字符

先来说说php变量的命名规则百度下一抓一大把 (1) PHP的变量名区分大小写; (2) 变量名必须以美元符号$开始; (3) 变量名开头可以以下划线开始; (4) 变量名不能以数字字符开头.   其实所有编程都类似的命名规范就是 1. 变量第一个字符最好是 字母或_不能以数字开头 2. 第二个字符开始允许 数字字母_   好了差不多就是这样了但是这不是我们要说的重点. 今天我们说说 PHP 变量的可用字符不仅仅是 数字字母_ 哦.   前几天QQ上一朋友发我一个shell是加密过的通篇乱码不过