0

I create rrd with this config:

rrdtool create cpu.rrd --start N --step=1\
        DS:user:GAUGE:2:0:100 \
        DS:system:GAUGE:2:0:100 \
        DS:nice:GAUGE:2:0:100 \
        DS:idle:GAUGE:2:0:100 \
        RRA:LAST:0.9:1:28800

and update with this loop (this my sample to test data entry):

I=1; while true; do rrdtool update cpu.rrd -t user:system:nice:idle N:10:10:11:$I; (( I++ )); sleep 1; done

after that i dump xml file:

    <!-- 2016-01-18 13:36:52 IRST / 1453111612 --> <row><v>1.0000000000e+01</v><v>1.0000000000e+01</v><v>1.1000000000e+01</v><v>1.3740088000e+01</v></row>
                    <!-- 2016-01-18 13:36:53 IRST / 1453111613 --> <row><v>1.0000000000e+01</v><v>1.0000000000e+01</v><v>1.1000000000e+01</v><v>1.4716793000e+01</v></row>
                    <!-- 2016-01-18 13:36:54 IRST / 1453111614 --> <row><v>1.0000000000e+01</v><v>1.0000000000e+01</v><v>1.1000000000e+01</v><v>**1.5693714000e+01**</v></row>
                    <!-- 2016-01-18 13:36:55 IRST / 1453111615 --> <row><v>1.0000000000e+01</v><v>1.0000000000e+01</v><v>1.1000000000e+01</v><v>**1.6669438000e+01**</v></row>
            </database>

4th column must be 16 17 18 and so on. why these value not same?

1 Answer 1

2

Yes, this is because you are adding date at arbitrary points in time. While you have setup rrdtool to store data at regular 1 second intervals ...

Updating your data with 'N:' records the precise time the update was executed (1/1000 s precision) and re-samples the given data to the desired precise 1 second interval, aligned to GMT time.

Not the answer you're looking for? Browse other questions tagged or ask your own question.