Skip to main content

Module units

Module units 

Source
Expand description

§units module

All main systemd unit statistics. Counts of types of units, unit states and queued jobs. We also house service specific statistics and system unit states.

Re-exports§

pub use crate::unit_constants::is_unit_unhealthy;
pub use crate::unit_constants::SystemdUnitActiveState;
pub use crate::unit_constants::SystemdUnitLoadState;

Structs§

ListedUnit
ServiceStats
Per-service metrics from the org.freedesktop.systemd1.Service and Unit D-Bus interfaces. Ref: https://www.freedesktop.org/software/systemd/man/org.freedesktop.systemd1.html
SystemdUnitStats
Aggregated systemd unit statistics: counts by type, load state, active state, plus optional per-service and per-timer detailed metrics
UnitFilesScope
Unit file counts for a scope (root or user), broken down by unit type.
UnitFilesStats
Unit file statistics collected from the filesystem for root and user scopes.
UnitStates
Per-unit state tracking combining active state, load state, and computed health. Ref: https://www.freedesktop.org/software/systemd/man/org.freedesktop.systemd1.html
UnitsCollectionTimings
Inner timing breakdown for the units collector D-Bus phases.

Enums§

MonitordUnitsError

Constants§

SERVICE_FIELD_NAMES
UNIT_FIELD_NAMES
UNIT_STATES_FIELD_NAMES

Functions§

collect_unit_files_stats
Collect unit file statistics from the filesystem. fs_root is prepended to all paths — empty string for the host, /proc/<pid>/root for containers.
parse_state
Parse state of a unit into our unit_states hash.
parse_unit_state
Pull all units from dbus and count how system is setup and behaving
update_unit_stats
Async wrapper that can update unit stats when passed a locked struct. fs_root is prepended to filesystem paths for unit file stats — empty string for the host, /proc/<pid>/root for containers.