The device-mapper statistics facility allows separate performance
counters to be maintained for arbitrary regions of devices. A
region may span any range: from a single sector to the whole
device. A region may be further sub-divided into a number of
distinct areas (one or more), each with its own counter set. In
this case a summary value for the entire region is also available
for use in reports.
In addition, one or more regions on one device can be combined
into a statistics group. Groups allow several regions to be
aggregated and reported as a single entity; counters for all
regions and areas are summed and used to report totals for all
group members. Groups also permit the assignment of an optional
alias, allowing meaningful names to be associated with sets of
regions.
The group metadata is stored with the first (lowest numbered)
region_id
in the group: deleting this region will also delete the
group and other group members will be returned to their prior
state.
By default new regions span the entire device. The --start
and
--length
options allows a region of any size to be placed at any
location on the device.
Using offsets it is possible to create regions that map
individual objects within a block device (for example:
partitions, files in a file system, or stripes or other
structures in a RAID volume). Groups allow several non-contiguous
regions to be assembled together for reporting and data
aggregation.
A region may be either divided into the specified number of
equal-sized areas, or into areas of the given size by specifying
one of --areas
or --areasize
when creating a region with the
create
command. Depending on the size of the areas and the device
region the final area within the region may be smaller than
requested.
Region identifiers
Each region is assigned an identifier when it is created that is
used to reference the region in subsequent operations. Region
identifiers are unique within a given device (including across
different program_id
values).
Depending on the sequence of create and delete operations, gaps
may exist in the sequence of region_id
values for a particular
device.
The region_id
should be treated as an opaque identifier used to
reference the region.
Group identifiers
Groups are also assigned an integer identifier at creation time;
like region identifiers, group identifiers are unique within the
containing device.
The group_id
should be treated as an opaque identifier used to
reference the group.