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§
- Listed
Unit - Service
Stats - 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
- Systemd
Unit Stats - Aggregated systemd unit statistics: counts by type, load state, active state, plus optional per-service and per-timer detailed metrics
- Unit
Files Scope - Unit file counts for a scope (root or user), broken down by unit type.
- Unit
Files Stats - Unit file statistics collected from the filesystem for root and user scopes.
- Unit
States - Per-unit state tracking combining active state, load state, and computed health. Ref: https://www.freedesktop.org/software/systemd/man/org.freedesktop.systemd1.html
- Units
Collection Timings - Inner timing breakdown for the units collector D-Bus phases.
Enums§
Constants§
Functions§
- collect_
unit_ files_ stats - Collect unit file statistics from the filesystem.
fs_rootis prepended to all paths — empty string for the host,/proc/<pid>/rootfor 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_rootis prepended to filesystem paths for unit file stats — empty string for the host,/proc/<pid>/rootfor containers.