[rrd-users] rrdlib: Are the API functions that avoid double string conversion?

Matthias Nagel matthias.h.nagel at gmail.com
Thu May 29 12:34:46 CEST 2014


Hello,

I am writing a C++ application that needs to update a RRD file. A had a look into "rrd_tool.c" and I found this tread https://www.mail-archive.com/rrd-users@lists.oetiker.ch/msg10245.html. Well, I see how to get working code that does what I want to do, but actually I dislike the idea to convert the (numeric) variables of my program into an array of strings (aka argv[]) such that the function "rrd_update" can convert it back.

Is there any second level of API function that are a little bit more low level? I think of a function with the following signature:

int update(
  const char* rrdFile,
  unsigned long timestamp,
  const unsigned int dsIndexes[],
  const double values[]
);

Moreover, my program runs as a daemon and  the pdp step frequency is 1 second. Hence, I would like to open the rrd file only once in the beginning, perform an update every second and close the file only if the daemon terminates. (Of course, the updates should be flushed to disk once in I while, such that data isn't lost in case of a crash.) Is there anything like a concept of file handles? I.e.

struct rrdfile_t { ... };

int open(  const char* rrdFile, rrdfile_t* handle )

int update( rrdfile_t* handle, ... /* as above */ )

int close( rrdfile_t* handle )


I had a look at "rrd_update.c" in order to find out what "rrd_update( int argc, char* argv[] )" does but that seemed a bit too low-level.

Thanks, Matthias

-- 
Matthias Nagel
Parkstraße 27
76131 Karlsruhe

Festnetz: +49-721-96869289
Mobil: +49-151-15998774
e-Mail: matthias.h.nagel at gmail.com
ICQ: 499797758
Skype: nagmat84 



More information about the rrd-users mailing list