Data set

From collectd Wiki
Jump to: navigation, search

The data_set_t structure describes a value being passed around in collectd. It serves a similar purpose as a schema in relational databases and describes the data contained in a value_list_t structure. The type field in the value list is used to refer to one specific data set. The two terms, “data set” and “type”, are often used interchangeably in the documentation.

The following information is stored in this structure:

  • A type (a name), by which this struct is uniquely identified.
  • One of more data sources, where each data source contains:

Definition of the struct

The structure is defined in src/plugin.h as follows:

 struct data_source_s
 {
   char   name[DATA_MAX_NAME_LEN];
   int    type;
   double min;
   double max;
 };
 typedef struct data_source_s data_source_t;
 
 struct data_set_s
 {
   char           type[DATA_MAX_NAME_LEN];
   int            ds_num;
   data_source_t *ds;
 };
 typedef struct data_set_s data_set_t;

Definition of new types

Types are defined in a configuration file called types.db. See the types.db(5) manual page for details.

Look-up

The data set can be queried from the daemon using the plugin_get_ds function declared in src/plugin.h. The type member of a value_list_t can be used for this.

Personal tools
Namespaces

Variants
Actions
Navigation
Tools