From: Dan Molik Date: Tue, 10 Nov 2015 19:38:48 +0000 (-0500) Subject: Export rrdc_create and rrdc_create_r2 - Dan Molik X-Git-Tag: v1.6.0~21^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F687%2Fhead;p=thirdparty%2Frrdtool-1.x.git Export rrdc_create and rrdc_create_r2 - Dan Molik Export the client functions that create rrds --- diff --git a/doc/librrd.pod b/doc/librrd.pod index 5c4b997c..cb4b5548 100644 --- a/doc/librrd.pod +++ b/doc/librrd.pod @@ -249,6 +249,157 @@ returns a text diagnostic suitable for use in user error messages. =back +=head1 CLIENT FUNCTIONS + +The following functions are used to connected to an rrdcached instance, +either via a unix or inet address, and create, update, or gather statistics +about a specified RRD database file. + +All of the following functions are specified in the C +header file. + +=over 4 + +=item B + +Connect to a running rrdcached instance, specified via C. + +=item B + +Return a boolean int to determine if the client is connected to the +rrdcache daemon specified by the C parameter. + +=item B + +Return a boolean int if any daemon connections are connected. + +=item B + +Disconnect gracefully from all present daemon connections. + +=item B + +Update the RRD C via the rrdcached. Where C +is the number of values to update and C are the new values to add. + +=item B + +Grab rrd info of the RRD C from the connected cache daemon. +This function returns an rrd_info_t structure of the following format: + + typedef struct rrd_blob_t { + unsigned long size; /* size of the blob */ + unsigned char *ptr; /* pointer */ + } rrd_blob_t; + + typedef enum rrd_info_type { RD_I_VAL = 0, + RD_I_CNT, + RD_I_STR, + RD_I_INT, + RD_I_BLO + } rrd_info_type_t; + + typedef union rrd_infoval { + unsigned long u_cnt; + rrd_value_t u_val; + char *u_str; + int u_int; + rrd_blob_t u_blo; + } rrd_infoval_t; + + typedef struct rrd_info_t { + char *key; + rrd_info_type_t type; + rrd_infoval_t value; + struct rrd_info_t *next; + } rrd_info_t; + +=item B + +Grab the unix epoch of the last time RRD C was updated. + +=item B + +Get the first value of the first sample of the RRD C, +of the C RRA (Round Robin Archive) index number. +The RRA index number can be determined by pulling the rrd_info_t +off the RRD. + +=item B + +Create RRD database of path C. +The RRD will have a step size of C, the unix epoch timestamp to +start collecting data from. The number of data sources and RRAs C and +the definitions of the data sources and RRAs C. Lastly weather or +not to overwrite an existing RRD if one is found with the same +filename; C. + +=item B + +Create and RRD database in the daemon. B has the same +parameters as B with two added parameters of; C +and C