2

I am using rrd4j to do what rrd4j does, and it works great. However, if I shut down my app and start it back up again, the data from the previous session will be gone.

I am using a normal file backend, like so:

RrdDef rrdDef = new RrdDef( "/path/to/my/file", 3000 );

Is there a setting or something I need to trigger to make rrd4j load the data from the previous session?

jakewins
  • 963
  • 1
  • 6
  • 6

1 Answers1

3

Seems you should use RrdDb("/path/to/my/file") instead. From Javadocs:

RrdDb(java.lang.String path): Constructor used to open already existing RRD in R/W mode, with a default storage (backend) type (file on the disk).

And also:

RrdDb(RrdDef rrdDef): Constructor used to create new RRD object from the definition.

nawroth
  • 4,321
  • 1
  • 24
  • 21