rrd_version = "0001"
step = 300
last_update = 955892996
+ header_size = 2872
ds[a].type = "GAUGE"
ds[a].minimal_heartbeat = 600
ds[a].min = NaN
rrd_set_error("unknown data source name '%s'", ds_nam);
return -1;
}
+
+off_t rrd_get_header_size(
+ rrd_t *rrd)
+{
+ return sizeof(stat_head_t) + \
+ sizeof(ds_def_t) * rrd->stat_head->ds_cnt + \
+ sizeof(rra_def_t) * rrd->stat_head->rra_cnt + \
+ sizeof(time_t) + \
+ sizeof(live_head_t) + \
+ sizeof(pdp_prep_t) * rrd->stat_head->ds_cnt + \
+ sizeof(cdp_prep_t) * rrd->stat_head->ds_cnt * rrd->stat_head->rra_cnt + \
+ sizeof(rra_ptr_t) * rrd->stat_head->rra_cnt;
+}
info.u_cnt = rrd.live_head->last_up;
cd = rrd_info_push(cd, sprintf_alloc("last_update"), RD_I_CNT, info);
+ info.u_cnt = rrd_get_header_size(&rrd);
+ cd = rrd_info_push(cd, sprintf_alloc("header_size"), RD_I_CNT, info);
+
for (i = 0; i < rrd.stat_head->ds_cnt; i++) {
info.u_str = rrd.ds_def[i].dst;
/* Are we creating a new file? */
if((rdwr & RRD_CREAT) && (rrd->stat_head != NULL))
{
- header_len = \
- sizeof(stat_head_t) + \
- sizeof(ds_def_t) * rrd->stat_head->ds_cnt + \
- sizeof(rra_def_t) * rrd->stat_head->rra_cnt + \
- sizeof(time_t) + \
- sizeof(live_head_t) + \
- sizeof(pdp_prep_t) * rrd->stat_head->ds_cnt + \
- sizeof(cdp_prep_t) * rrd->stat_head->ds_cnt * rrd->stat_head->rra_cnt + \
- sizeof(rra_ptr_t) * rrd->stat_head->rra_cnt;
+ header_len = rrd_get_header_size(rrd);
value_cnt = 0;
for (ui = 0; ui < rrd->stat_head->rra_cnt; ui++)
long ds_match(
rrd_t *rrd,
char *ds_nam);
+ off_t rrd_get_header_size(
+ rrd_t *rrd);
double rrd_diff(
char *a,
char *b);