#[allow(missing_docs)]
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SwapDiagnostics
{
pub page_cluster: DiagnosticUnobtainableResult<Either<PageCluster, i32>>,
pub swappiness: DiagnosticUnobtainableResult<Swappiness>,
pub swaps: DiagnosticUnobtainableResult<Swaps>,
}
impl SwapDiagnostics
{
fn gather(proc_path: &ProcPath) -> Self
{
Self
{
page_cluster: PageCluster::read(proc_path).map_err(DiagnosticUnobtainable::from),
swappiness: Swappiness::read(proc_path).map_err(DiagnosticUnobtainable::from),
swaps: Swaps::parse(proc_path).map_err(DiagnosticUnobtainable::from)
}
}
}