#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum NumaNodeStatisticName
{
NumberOFreePages,
NumberOfBatchAllocatedPages,
NumberOfInactiveAnonymousPages,
NumberOfActiveAnonymousPages,
NumberOfInactiveFilePages,
NumberOfActiveFilePages,
NumberOfUnevictablePages,
NumberOfLockedPages,
NumberOfAnonymousPages,
NumberOfMappedPages,
NumberOfFilePages,
NumberOfDirtyPages,
NumberOfWritebackPages,
NumberOfReclaimableSlabPages,
NumberOfUnreclaimableSlabPages,
NumberOfPageTablePages,
NumberOfKernelStackPages,
NumberOfUnstablePages,
NumberOfBouncePages,
NumberOfVirtualMemoryWritePages,
NumberOfVirtualMemoryImmediateReclaimPages,
NumberOfWritebackTemporaryPages,
NumberOfIsolatedAnonymousPages,
NumberOfIsolatedFilePages,
NumberOfShmemPages,
NumberOfDirtiedPages,
NumberOfWrittenPages,
NumberOfAnonymousTransparentHugePages,
NumberOfFreeCmaPages,
NumaHit,
NumaMiss,
NumaForeign,
NumaInterleaveHit,
NumaLocalNode,
NumaOtherNode,
Unknown(String),
}
impl NumaNodeStatisticName
{
#[inline]
pub fn parse(name: &str) -> NumaNodeStatisticName
{
match name
{
"nr_free_pages" => NumaNodeStatisticName::NumberOFreePages,
"nr_alloc_batch" => NumaNodeStatisticName::NumberOfBatchAllocatedPages,
"nr_inactive_anon" => NumaNodeStatisticName::NumberOfInactiveAnonymousPages,
"nr_active_anon" => NumaNodeStatisticName::NumberOfActiveAnonymousPages,
"nr_inactive_file" => NumaNodeStatisticName::NumberOfInactiveFilePages,
"nr_active_file" => NumaNodeStatisticName::NumberOfActiveFilePages,
"nr_unevictable" => NumaNodeStatisticName::NumberOfUnevictablePages,
"nr_mlock" => NumaNodeStatisticName::NumberOfLockedPages,
"nr_anon_pages" => NumaNodeStatisticName::NumberOfAnonymousPages,
"nr_mapped" => NumaNodeStatisticName::NumberOfMappedPages,
"nr_file_pages" => NumaNodeStatisticName::NumberOfFilePages,
"nr_dirty" => NumaNodeStatisticName::NumberOfDirtyPages,
"nr_writeback" => NumaNodeStatisticName::NumberOfWritebackPages,
"nr_slab_reclaimable" => NumaNodeStatisticName::NumberOfReclaimableSlabPages,
"nr_slab_unreclaimable" => NumaNodeStatisticName::NumberOfUnreclaimableSlabPages,
"nr_page_table_pages" => NumaNodeStatisticName::NumberOfPageTablePages,
"nr_kernel_stack" => NumaNodeStatisticName::NumberOfKernelStackPages,
"nr_unstable" => NumaNodeStatisticName::NumberOfUnstablePages,
"nr_bounce" => NumaNodeStatisticName::NumberOfBouncePages,
"nr_vmscan_write" => NumaNodeStatisticName::NumberOfVirtualMemoryWritePages,
"nr_vmscan_immediate_reclaim" => NumaNodeStatisticName::NumberOfVirtualMemoryImmediateReclaimPages,
"nr_writeback_temp" => NumaNodeStatisticName::NumberOfWritebackTemporaryPages,
"nr_isolated_anon" => NumaNodeStatisticName::NumberOfIsolatedAnonymousPages,
"nr_isolated_file" => NumaNodeStatisticName::NumberOfIsolatedFilePages,
"nr_shmem" => NumaNodeStatisticName::NumberOfShmemPages,
"nr_dirtied" => NumaNodeStatisticName::NumberOfDirtiedPages,
"nr_written" => NumaNodeStatisticName::NumberOfWrittenPages,
"nr_anon_transparent_hugepages" => NumaNodeStatisticName::NumberOfAnonymousTransparentHugePages,
"nr_free_cma" => NumaNodeStatisticName::NumberOfFreeCmaPages,
"numa_hit" => NumaNodeStatisticName::NumaHit,
"numa_miss" => NumaNodeStatisticName::NumaMiss,
"numa_foreign" => NumaNodeStatisticName::NumaForeign,
"interleave_hit" => NumaNodeStatisticName::NumaInterleaveHit,
"local_node" => NumaNodeStatisticName::NumaLocalNode,
"other_node" => NumaNodeStatisticName::NumaOtherNode,
other @ _ => NumaNodeStatisticName::Unknown(other.to_owned()),
}
}
}