Why does rrd4j only log every four minutes?

Hi there,

I use rrd4j to log certain number items and I configured them to use the everyMinute strategy. Here is an extract of my rrd4j.persist:

Strategies {
// for rrd charts, we need a cron strategy
everyMinute : “0 * * * * ?”
}
Items {
WZ_Innr_POWER : strategy = everyMinute
}

However, if I query the persistence layer in order to get a json with the logged values via

http://:8080/rest/persistence/items/WZ_Innr_POWER

I only get a json with an entry every four minutes, thus resulting in 360 entries for 24h instead of 1440 entries which I would assume:

{“name”:“WZ_Innr_POWER”,“datapoints”:“275”,“data”:[{“time”:1549668000000,“state”:“12.333333333333334”},{“time”:1549668240000,“state”:“13.0”},…

I didn’t configured anything in the services/rrd4j.cfg so it still looks like this:

# please note that currently the first archive in each RRD defines the consolidation
# function (e.g. AVERAGE) used by OpenHAB, thus only one consolidation function is
# fully supported
#
# default_numeric and default_other are internally defined defnames and are used as
# defaults when no other defname applies
#<defname>.def=[ABSOLUTE|COUNTER|DERIVE|GAUGE],<heartbeat>,[<min>|U],[<max>|U],<step>
#<defname>.archives=[AVERAGE|MIN|MAX|LAST|FIRST|TOTAL],<xff>,<steps>,<rows>
#<defname>.items=<list of items for this defname>

Do you have an idea what is going wrong here? What do I need to change in order to get minute-wise logs?

Thanks!

@opus, what are the default settings of rrd4j?
I have the same result as the OP
Even the last events:

    {
      "time": 1549735440000,
      "state": "19.6"
    },
    {
      "time": 1549735680000,
      "state": "19.6"
    },
    {
      "time": 1549735920000,
      "state": "19.6"
    }

When using the REST call without any time setting the data for the last 2r hours are fetched. Using the default setup this timeframe is NOT covered in the archive 1, which is the only one keeping values for every minute.

Please look into this Thread

In other words, do a REST call which covers no more then the LAST 8 hours and you will see the minute values.

1 Like

Can you tell me what I need to do in order to cover 24 hours with 1 minute resolution?

Would this work?

“AVERAGE,0.5,1,1440:AVERAGE,0.5,4,360:AVERAGE,0.5,14,644:AVERAGE,0.5,60,720:AVERAGE,0.5,720,730:AVERAGE,0.5,10080,520”);

The first archive does do that, however the second does cover 24 hours as well. I’d delete it and keep the following ( if you want to keep values for longer then 24 houres).
When changing the archives I think you need to stop openhab, de,ete the old .rrd files and start again.

This is my archive setting for values by day, week, month and year.

TempLogger.archives=MAX,.5,1,1440:MAX,.5,5,2016:MAX,.5,15,2668:MAX,.5,240,1460

1 Like

Is it sufficient to only set the .archives in the rrd4j.cfg or do I need to define the .def and .items as well in this file?

Edit: yes, they seem to be necessary. Now, I don’t understand what the config in rrd4j.persist is necessary for. The documentation of this service isn’t that good. :confused:

I have that on my personell todo list. It moved up now.

1 Like

Done the change, lets see when (and if) it gets merged.

[Edit] If your problem is solved, please mark this thread as solved by selecting the checkmark (icon on the lower boundary of each post) on the answer that holds the solution.

1 Like