mem-info-0.3.0.0: Print the core memory usage of programs
Copyright(c) 2022 Tim Emiola
LicenseBSD3
MaintainerTim Emiola <adetokunbo@emio.la>
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.MemInfo.SysInfo

Description

This module provides data types that

along with functions that use these types.

Synopsis

define reports

data ReportBud Source #

Gathers the inputs needed to generate a memory usage report

Instances

Instances details
Show ReportBud Source # 
Instance details

Defined in System.MemInfo.SysInfo

Eq ReportBud Source # 
Instance details

Defined in System.MemInfo.SysInfo

mkReportBud :: NonEmpty ProcessID -> IO (Maybe ReportBud) Source #

Construct a ReportBud from some ProcessIDs

Generates values for the other fields by inspecting the system

The result is Nothing only when the KernelVersion cannot be determined

indicate calculation flaws

data RamFlaw Source #

Describes inaccuracies in the RAM calculation

Constructors

NoSharedMem

no shared mem is reported

SomeSharedMem

some shared mem not reported

ExactForIsolatedMem

accurate only considering each process in isolation

Instances

Instances details
Show RamFlaw Source # 
Instance details

Defined in System.MemInfo.SysInfo

Eq RamFlaw Source # 
Instance details

Defined in System.MemInfo.SysInfo

Methods

(==) :: RamFlaw -> RamFlaw -> Bool #

(/=) :: RamFlaw -> RamFlaw -> Bool #

Ord RamFlaw Source # 
Instance details

Defined in System.MemInfo.SysInfo

data SwapFlaw Source #

Describes inaccuracies in the swap measurement

Constructors

NoSwap

not available

ExactForIsolatedSwap

accurate only considering each process in isolation

Instances

Instances details
Show SwapFlaw Source # 
Instance details

Defined in System.MemInfo.SysInfo

Eq SwapFlaw Source # 
Instance details

Defined in System.MemInfo.SysInfo

Ord SwapFlaw Source # 
Instance details

Defined in System.MemInfo.SysInfo

checkForFlaws :: ReportBud -> IO ReportBud Source #

Examine the target system for RamFlaws and SwapFlaws, and update bud reflect the findings.

fmtRamFlaws :: RamFlaw -> Text Source #

Provide Text that explains the RamFlaw

fmtSwapFlaws :: SwapFlaw -> Text Source #

Provide Text that explains the SwapFlaw

system kernel version

type KernelVersion = (Natural, Natural, Natural) Source #

Represents a version of Linux kernel

readKernelVersion :: IO (Maybe KernelVersion) Source #

Determines the version of the Linux kernel on the current system.

fickleSharing :: KernelVersion -> Bool Source #

On linux kernels before smaps became available, there was no reliable way to determine how much of a processes memory was shared

http://lkml.org/lkml/2005/7/6/250