linux下的几个用来方便把实验数据转换成图形表示的小工具:
gnuplot:
plotutils:
graphviz:(其实一点都不小)。
egpyt:create call graph from gcc RTL dump.
linux下的几个用来方便把实验数据转换成图形表示的小工具:
gnuplot:
plotutils:
graphviz:(其实一点都不小)。
egpyt:create call graph from gcc RTL dump.
rrdtool采用的是自己的round robin database.理解它的内部存储格式就可以知道怎么使用rrdtool。rrdtool有很多命令,其中最主要的是create命令。
rrdtool create 用法:
rrdtool create filename [--start|-b start time] [--step|-s step] [DS:ds-name:DST:dst arguments] [RRA:CF:cf arguments]
其中start time是表示数据只记录大于这个时间的值,它是以1970-01-01开始的秒数。
step表示每次记录的时间间隔。
DS:ds-name:DST:dst arguments
DS是关键字,ds-name是数据库内部表示的名字。DST有GAUGE, COUNTER, DERIVE, ABSOLUTE,COMPUTE几种。
DST defines the Data Source Type. The remaining arguments of a data source entry depend on the data
source type. For GAUGE, COUNTER, DERIVE, and ABSOLUTE the format for a data source entry is:
DS:ds-name:GAUGE | COUNTER | DERIVE | ABSOLUTE:heartbeat:min:max
For COMPUTE data sources, the format is:
DS:ds-name:COMPUTE:rpn-expression
前4种的区别:
Values = 300, 600, 900, 1200
Step = 300 seconds
COUNTER DS = 1, 1, 1, 1
DERIVE DS = 1, 1, 1, 1 (可以为负数)
ABSOLUTE DS = 1, 2, 3, 4
GAUGE DS = 300, 600, 900, 1200
RRA:CF:cf argumnets
RRA:AVERAGE | MIN | MAX | LAST:xff:steps:rows
RRA是关键字,CF为集合函数,可以是MIN,MAX,AVERAGE,LAST.xff表示超过这个数是认为unknow,
steps表示计算的间隔,rows表示记录的行数。
RRDtool是代表 “Round Robin Database tool” 。
所谓的“Round Robin” 其实是一种存储数据的方式,使用固定大小的空间来存储数据,并有一个指针指向最新的数据的位置。我们可以把用于存储数据的数据库的空间看成一个圆,上面有很多刻度。这些刻度所在的位置就代表用于存储数据的地方。所谓指针,可以认为是从圆心指向这些刻度的一条直线。指针会随着数据的读写操作自动移动。要注意的是,这个圆没有起点和终点,所以指针可以一直移动,而不用担心到达终点后就无法前进的问题。在一段时间后,当所有的空间都存满了数据,就又从头开始存放。这样整个存储空间的大小就是一个固定的数值。所以RRDtool就是使用类似的方式来存放数据的工具,RRDtool所使用的数据库文件的后缀名是 ‘.rrd’。
要加深理解rrdtool的使用,可以先了解round robin database的原理及存储结构。
|
char cookie[4] |
‘RRD\0′ |
RRD文件标志 |
|
char version[5] |
’0003\0′ |
RRD文件版本 |
|
double float_cookie |
8.642135E130 |
Magic number |
|
unsigned long ds_cnt |
定义的DS个数 |
|
|
unsigned long rra_cnt |
定义的RRA个数 |
|
|
unsigned long pdp_step |
pdp时间间隔 |
|
|
unival par[10] |
保留,未使用 |
|
|
char ds_nam[DS_NAM_SIZE] |
DS的名称,DS_NAM_SIZE=20 %19[a-zA-Z0-9_-] |
|
|
char dst[DST_SIZE] |
DS的类型,DST_SIZE=20。%19[A-Z] 目前有5种: GAUGE COUNTER DERIVE ABSOLUTE COMPUTE |
|
|
unival par[10] |
DS的参数队列, 前4种的参数有:heartbeat:min:max 后1种的参数有:rpn-expression |
|
|
. . . . . . |
ds_cnt 次 |
|
|
char cf_nam[CF_NAM_SIZE] |
CF的名称,CF_NAM_SIZE=20,%19[A-Z] 目前有9种: AVERAGE, MIN, MAX, LAST HWPREDICT , SEASONAL DEVPREDICT , DEVSEASONA FAILURES |
|
|
unsigned long row_cnt |
存储记录的行数,超过后会循环覆盖 |
|
|
unsigned long pdp_cnt |
cf函数执行时,需要的pdp个数 |
|
|
unival par[MAX_RRA_PAR_EN] |
RRA的参数队列,MAX_RRA_PAR_EN=10 |
|
|
. . . . . . |
rra_cnt 次 |
|
|
time_t last_up |
最后一次更新的秒数部分 |
|
|
long last_up_usec |
最后一次跟新的微秒数部分 |
|
|
char last_ds[LAST_DS_LEN] |
最后一次更新后ds的值 LAST_DS_LEN=30 |
|
|
unival scratch[10] |
最后一次更新后pdp的相关数值,包括: PDP_unkn_sec_cnt,此次step以来未知的秒数 PDP_val,此次step的pdp值,根据dst的不同, 算法也不相同 |
|
|
. . . . . . |
ds_cnt 次 |
|
|
Unival scratch[MAX_CDP_PAR_EN] |
最后一次更新后cdp的相关数值 |
|
|
. . . . . . |
ds_cnt * rra_cnt 次 |
|
|
unsigned long cur_row |
指向RRA当前的记录 |
|
|
. . . . . . |
rra_cnt 次 |
|
|
*RRA 0 (0,0) . . . . . . . . . . . . . . . . . . . . . . . . . ( ds_cnt -1 , 0) . . . (0, row_cnt -1) . . . . . . . . . . . (ds_cnt -1, row_cnt -1) *RRA 1 *RRA 2 *RRA rra_cnt -1 |
ds: Data Source (ds) providing input to the database.
dst: Data Source Type (dst).
pdp: Primary Data Point (pdp).
cf: Consolidation Function (cf).
cdp: Consolidated Data Point (cdp) is the long term storage format for data in the rrd database.
rra: Round Robin Archive (rra). This is the place where the consolidated data points (cdp) get stored.
rrdtool create filename [--start|-b start time] [--step|-s step] \
[DS:ds-name:DST:dst arguments] \
[RRA:CF:cf arguments]
step:Specifies the base interval in seconds with which data will be fed into the RRD。
dst argumet: 有heartbeat:min:max组成。其中最小,最大值表示pdp的范围,可以为UNKNOW。heartbeat:表示2次采样之间最大有效的时间间隔。
Rrdtool-1.2.28后,对pdp的取UNKNOW值有点不同。查看了changelog,原来是作为bug修复了。
http://bbs.chinaunix.net/viewthread.php?tid=864861&highlight=rrdtool
Q:如何从svn版本库中导出一个目录到一个新的版本库中,并且保存原有的commit log?
A: 基本的步骤如下:
1.从sevenj中导出整个库的内容
sevenj$ svnadmin dump /var/svn/sevenj > sevenj.dump
2.从sevenj.dump文件中过滤出要导出的目录
sevenj$ cat sevenj.dump | svndumpfilter include /note/ > note.dump
3.把过滤后的文件重新导入到新库中
sevenj$ svnadmin load /var/svn/new –parent-dir note < note.dump
Other:
sevenj$ svmdumpfilter help include
usage: svndumpfilter include PATH_PREFIX…
Valid options:
–drop-empty-revs : Remove revisions emptied by filtering.
–renumber-revs : Renumber revisions left after filtering.
–skip-missing-merge-sources : Skip missing merge sources.
–targets ARG : Pass contents of file ARG as additional args
–preserve-revprops : Don’t filter revision properties.
–quiet : Do not display filtering statistics.
http://svn.collab.net/repos/svn/trunk/notes/dump-load-format.txt