pub async fn stat_collector(
config: Config,
maybe_locked_stats: Option<Arc<RwLock<MonitordStats>>>,
output_stats: bool,
maybe_connection: Option<Connection>,
) -> Result<Option<Connection>, MonitordError>Expand description
Main statictic collection function running what’s required by configuration in parallel
Takes an optional locked stats struct to update and to output stats to STDOUT or not.
Takes an optional D-Bus connection. Returns Some(connection) if the
collection cycle completed without errors (meaning the connection is reusable),
None if errors occurred.