Databases Reference
In-Depth Information
DS
is a keyword that stands for
data source
.
DS
is essentially what I have been calling metric so far.
variable_name
identifi es the data source. In the example,
cpu
is a variable name for holding the
CPU utilization value.
data_source_type
defi nes the type of value stored for a data source. The
value in this example is
GAUGE
. The possible values for a
data_source_type
are as follows:
COUNTER
— Records the rate of change over a period. The values in this case are always
increasing.
➤
DERIVE
— Similar to a
COUNTER
but can accept negative values.
ABSOLUTE
— Also records rate of change but the current value stored is always in relation to
the last value. The current value is different from the last value. In math terms, it's always
the “delta.”
➤
➤
GAUGE
— Records actual value and not rate of change.
RRDTool records values at a defi ned interval. In the example,
myrrddb.rrd
would expect a CPU
utilization value to be available every 60 seconds. The RRDTool database, unlike an RDBMS, expects
a value to be made available at a predefi ned interval. This means that if it doesn't get a value, it records
it as
UNDEFINED
. The heartbeat value, which in the example is 120 seconds, is when the database thinks
the value is not present and then records it as
UNDEFINED
. If values don't come exactly as defi ned,
RRDTool has the capability to interpolate values if the record still arrives within the heartbeat interval.
The last two values,
min
and
max,
are boundary conditions for values. Data source values outside
these values are recorded as
UNDEFINED
. In the example, I assume the CPU utilization is a percentage
utilization value and therefore
0
and
100
mark the boundary conditions for such a measure.
➤
The last two lines depict the aggregation functions on the time series data. In the database
create
statement in the example, the last two lines are as follows:
RRA:AVERAGE:0.5:60:24 \
RRA:AVERAGE:0.5:1440:31
RRA
, like
DS
, is another keyword.
RRA
stands for Round Robin Archive. The RRA defi nitions follow
this format:
RRA:consolidation_function:xff:step:rows
consolidation_function
is an aggregation function.
AVERAGE
,
MINIMUM
,
MAXIMUM,
and
LAST
could
be possible
consolidation_function
values. In the example, two
RRA
defi nitions are included.
Both average data points. Consolidation functions operate on the values captured from the data
source. Therefore, in the example of CPU utilization,
RRA
values will be aggregates of the per-minute
CPU utilization recordings.
step
defi nes the aggregation bundle and
rows
specifi es the number of
aggregated records to be saved. In the example, a value of 60 for
steps
implies that the average
is calculated on the basis of 60 data points of the data source recordings. The recordings are every
minute so this means the averages are for every hour, because an hour has 60 minutes. The number of
rows to be archived is 24. Therefore, the fi rst
RRA
records average CPU utilization on a per-hour basis
and keeps records for a day.
The second
RRA
defi nition is an average CPU utilization for a day, and 31 days (or a month's worth)
of data is stored for this consolidation function.