[rrd-users] Different data values via libdbi mysql

Matthew Boehm matthew at matthewboehm.com
Thu Apr 19 22:58:42 CEST 2012


Hi all,
I am trying to verify that data coming from a .rra file is the same as 
from libdbi+mysql. I have a small sample data set that I'm testing on; 
just 6 points. The numbers are off by 1 time slot when from MySQL. Any 
ideas on this one?

Many thanks!

-Matthew

drmac at new [~]# rrdtool create command.rra \
  --start 1334862000 \
  --step 60 \
DS:val:DERIVE:60:0:500 \
RRA:AVERAGE:0.5:1:6 \
RRA:MIN:0.5:1:6 \
RRA:MAX:0.5:1:6

drmac at new [~]# rrdtool update command.rra \
1334862060:100 \
1334862120:150 \
1334862180:200 \
1334862240:275 \
1334862300:325 \
1334862360:450

drmac at new [~]# rrdtool xport --step 60 \
--start='20120419 14:00' --end='20120419 14:06' \
"DEF:val=command.rra:val:AVERAGE" \
XPORT:val:"select"

<?xml version="1.0" encoding="ISO-8859-1"?>

<xport>
   <meta>
     <start>1334862060</start>
     <step>60</step>
     <end>1334862060</end>
     <rows>7</rows>
     <columns>1</columns>
     <legend>
       <entry>select</entry>
     </legend>
   </meta>
   <data>
     <row><t>1334862060</t><v>NaN</v></row>
     <row><t>1334862120</t><v>8.3333333333e-01</v></row>
     <row><t>1334862180</t><v>8.3333333333e-01</v></row>
     <row><t>1334862240</t><v>1.2500000000e+00</v></row>
     <row><t>1334862300</t><v>8.3333333333e-01</v></row>
     <row><t>1334862360</t><v>2.0833333333e+00</v></row>
     <row><t>1334862420</t><v>NaN</v></row>
   </data>
</xport>

INSERT INTO stats3 (created_at, val) VALUES
(1334862060,100),
(1334862120,150),
(1334862180,200),
(1334862240,275),
(1334862300,325),
(1334862360,450);

DS_COMSELECT="sql//mysql/host=localhost/dbname=statstest/username=rrd/password=rrd/rrdminstepsize=60//stats3/created_at/val/derive"

drmac at new [~]# rrdtool xport --step 60 \
--start='20120419 14:00' --end='20120419 14:06' \
"DEF:val=$DS_COMSELECT:avg:AVERAGE" \
XPORT:val:"select"

<?xml version="1.0" encoding="ISO-8859-1"?>

<xport>
   <meta>
     <start>1334862060</start>
     <step>60</step>
     <end>1334862060</end>
     <rows>7</rows>
     <columns>1</columns>
     <legend>
       <entry>select</entry>
     </legend>
   </meta>
   <data>
     <row><t>1334862060</t><v>NaN</v></row>
     <row><t>1334862120</t><v>NaN</v></row>
     <row><t>1334862180</t><v>8.3333333333e-01</v></row>
     <row><t>1334862240</t><v>8.3333333333e-01</v></row>
     <row><t>1334862300</t><v>1.2500000000e+00</v></row>
     <row><t>1334862360</t><v>8.3333333333e-01</v></row>
     <row><t>1334862420</t><v>NaN</v></row>
   </data>
</xport>



More information about the rrd-users mailing list