[rrd-users] Strange GAUGE values when parsing MySQL output

Marc Powell marc at ena.com
Tue Aug 11 21:13:09 CEST 2009


On Aug 11, 2009, at 1:48 PM, Arthur Meeks Meeks wrote:

> The problem is:
>
> When I get the data from the MySQL, as I said, I get data such as:
> 0
> 1
> 2
> etc
>
> But those values are included in the rrd file as:
>             <!-- 2009-08-11 20:20:00 CEST / 1250014800 --> <row><v>  
> 1.6333333333e-01 </v></row>
>             <!-- 2009-08-11 20:25:00 CEST / 1250015100 --> <row><v>  
> 3.6666666667e-02 </v></row>
>             <!-- 2009-08-11 20:30:00 CEST / 1250015400 --> <row><v>  
> 0.0000000000e+00 </v></row>
>             <!-- 2009-08-11 20:35:00 CEST / 1250015700 --> <row><v>  
> 0.0000000000e+00 </v></row>
>             <!-- 2009-08-11 20:40:00 CEST / 1250016000 --> <row><v>  
> 0.0000000000e+00 </v></row>
>
> So the grahp is not showing the correct values, cause it should be  
> 1, 2...but instead it shows: 100M, 200M in the vertical axis

I think you mean to say 'm', as in milli, not 'M' as in Mega. They're  
several orders of magnitude different. For example, the first value  
above is of course '.16333333', not 1,633,333.3333.

> I've read that the common problem here is using COUNTER instead of  
> GAUGE, but as you can see, I'm using GAUGE to draw exactly, 0, 1, 2  
> etc..

Using GAUGE helps but you're not as much as you believe. Internally to  
RRDtool, they're still rates that fall into very specific interval  
buckets. If you want the exact values out that you put in, you must  
input the value on an even rrd STEP from the rrd START.

If you are not inputing the values with a timestamp that falls exactly  
on a step (bucket) from the start time, RRDtool will adjust the value  
based on how early or late you are from the bucket time. If you input  
early, the value will be increased. If you input late, the value will  
be decreased.

> The problem disappear when the value got from the MySQL is something  
> like: 3989
> Then the graph shows 3K, 3.5K, 4K etc in the vertical margin, which  
> is correct. But I don't understand why a value like: "1" is shown as  
> 100M in the graph.

The value was input very much head of the step time?

--
Marc



More information about the rrd-users mailing list