summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 874c9bd)
raw | patch | inline | side by side (parent: 874c9bd)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 22 Sep 2005 20:18:12 +0000 (20:18 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 22 Sep 2005 20:18:12 +0000 (20:18 +0000) |
program/src/rrd_graph.c | patch | blob | history | |
program/src/rrd_graph.h | patch | blob | history | |
program/src/rrd_graph_helper.c | patch | blob | history |
index d80b74c49f379f19680cd5434b9b556632e5d3b2..97f6d68bb7241f6ae7c819e84447f3ffb8785fa8 100644 (file)
--- a/program/src/rrd_graph.c
+++ b/program/src/rrd_graph.c
int i,ii;
int skip;
- /* pull the data from the log files ... */
+ /* pull the data from the rrd files ... */
for (i=0;i< (int)im->gdes_c;i++){
/* only GF_DEF elements fetch data */
if (im->gdes[i].gf != GF_DEF)
if ((strcmp(im->gdes[i].rrd, im->gdes[ii].rrd) == 0)
&& (im->gdes[i].cf == im->gdes[ii].cf)
&& (im->gdes[i].cf_reduce == im->gdes[ii].cf_reduce)
- && (im->gdes[i].start == im->gdes[ii].start)
- && (im->gdes[i].end == im->gdes[ii].end)
- && (im->gdes[i].step == im->gdes[ii].step)) {
+ && (im->gdes[i].start_orig == im->gdes[ii].start_orig)
+ && (im->gdes[i].end_orig == im->gdes[ii].end_orig)
+ && (im->gdes[i].step_orig == im->gdes[ii].step_orig)) {
/* OK, the data is already there.
** Just copy the header portion
*/
im->xsize = 400;
im->ysize = 100;
im->step = 0;
+ im->step_orig = 0;
im->ylegend[0] = '\0';
im->title[0] = '\0';
im->minval = DNAN;
index 5a8af09aff5e4bc2e7be626abcf8249fa607b569..b92ce9c9ece0517da0b98a9e0e6117b1e0726842 100644 (file)
--- a/program/src/rrd_graph.h
+++ b/program/src/rrd_graph.h
/* description of data fetched for the graph element */
time_t start,end; /* timestaps for first and last data element */
+ time_t start_orig,end_orig; /* timestaps for first and last data element */
unsigned long step; /* time between samples */
+ unsigned long step_orig; /* time between samples */
unsigned long ds_cnt; /* how many data sources are there in the fetch */
long data_first; /* first pointer to this data */
char **ds_namv; /* name of datasources in the fetch. */
index ec06d7789fd8115215551c2eb42ee4ba3d092ae0..08f74d1ff5e84034516584543eafe76609b97f8e 100644 (file)
@@ -568,6 +568,7 @@ rrd_parse_def(char *line, unsigned int *eaten, graph_desc_t *gdp, image_desc_t *
} else if (!strcmp("step",command)) {
i=0;
sscanf(&line[*eaten],"%lu%n",&gdp->step,&i);
+ gdp->step_orig = gdp->step;
(*eaten)+=i;
dprintf("- using step %lu\n",gdp->step);
} else if (!strcmp("start",command)) {
@@ -617,6 +618,8 @@ rrd_parse_def(char *line, unsigned int *eaten, graph_desc_t *gdp, image_desc_t *
gdp->start = start_tmp;
gdp->end = end_tmp;
+ gdp->start_orig = start_tmp;
+ gdp->end_orig = end_tmp;
dprintf("- start time %lu\n",gdp->start);
dprintf("- end time %lu\n",gdp->end);