From: Florian Forster Date: Mon, 11 May 2020 07:36:28 +0000 (+0200) Subject: types.db(5): Improve wording and document conventions. X-Git-Tag: collectd-5.12.0~35^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8dc2066c7beb86e55a8f2cf325e1ab978853b323;p=thirdparty%2Fcollectd.git types.db(5): Improve wording and document conventions. --- diff --git a/src/types.db.pod b/src/types.db.pod index f0af60e0f..92f9e1ed4 100644 --- a/src/types.db.pod +++ b/src/types.db.pod @@ -13,21 +13,49 @@ B =head1 DESCRIPTION -The types.db file contains one line for each data-set specification. Each line -consists of two fields delimited by spaces and/or horizontal tabs. The first -field defines the name of the data-set, while the second field defines a list -of data-source specifications, delimited by spaces and, optionally, a comma -(",") right after each list-entry. - -The format of the data-source specification has been inspired by RRDtool's -data-source specification. Each data-source is defined by a quadruple made up -of the data-source name, type, minimal and maximal values, delimited by colons -(":"): I:I:I:I. I may be either -B, B, B, or B. I and I define the -range of valid values for -data stored for this data-source. If B is specified for either the min or -max value, it will be set to unknown, meaning that no range checks will -happen. See L for more details. +The C file contains collectd's metric type specifications. Each line +describes one metric type, which is called "data set" in collectd. Each line +consists of two or more fields delimited by spaces and/or horizontal tabs. + +For example, the following defines two data sets, "bytes" and "total_bytes". + + bytes value:GAUGE:0:U + total_bytes value:DERIVE:0:U + +The first field defines the name of the data set. By convention, data set names +use lower-case alphanumeric characters and underscores (C<_>) only. Also by +convention, if a metric makes sense both as a cumulative metric (e.g. +C) I a non-cumulative metric (i.e. C), the cumulative +metric gets a C prefix. For example, C is a C and +C is a C. + +The second and each following field defines a named metric value, called "data +source". New data sets with multiple data sources are strongly discouraged. +Each field is a colon-separated tuple of the data source name, value type, +minimum and maximum values: IB<:>IB<:>IB<:>I. + +=over 4 + +=item + +I is, by convention, a lower-case alphanumeric string. If the data set +contains a single data source, it is called "value" by convention. Data source +names must be unique within a data set. + +=item + +I may be B, B, or B. For historic reasons a +type called B is also supported, but its use is strongly discouraged, +and it should not be used for new metric type definitions. + +=item + +I and I define the range of valid values this data source. Either or +both may be unbounded, which is specified by providing C instead of a +number. For cumulative metric values, I and I apply to the value's +rate, not the raw cumulative metric value. + +=back =head1 FILES