Copyright | (c) 2022 Tim Emiola |
---|---|
License | BSD3 |
Maintainer | Tim Emiola <adetokunbo@emio.la> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module provides types that model data from files in the Linux proc
filesystem
that track memory usage, combinators for parsing the files contents,
and for grouping the results.
Synopsis
- data MemUsage = MemUsage {}
- amass :: Ord a => Bool -> [(a, ProcUsage)] -> Map a MemUsage
- data ProcUsage = ProcUsage {}
- parseFromSmap :: Text -> ProcUsage
- parseFromStatm :: KernelVersion -> Text -> Maybe ProcUsage
- data ExeInfo = ExeInfo {}
- parseExeInfo :: Text -> ExeInfo
- parseStatusInfo :: Text -> Either BadStatus StatusInfo
- data StatusInfo = StatusInfo {}
- data BadStatus
Combine process memory metrics
Represents the measured memory usage of a program
amass :: Ord a => Bool -> [(a, ProcUsage)] -> Map a MemUsage Source #
Combine
, grouping them by the effective program nameProcUsage
Parse process memory metrics
Represents the memory metrics for a single process
parseFromStatm :: KernelVersion -> Text -> Maybe ProcUsage Source #
Parse
from the contents of /proc/<pid>/statmProcUsage
Parse /proc/<pid>/exe
Represents the information about a process obtained from /proc/<pid>/exe
Instances
Generic ExeInfo Source # | |
Show ExeInfo Source # | |
Eq ExeInfo Source # | |
Validity ExeInfo Source # | |
Defined in System.MemInfo.Proc validate :: ExeInfo -> Validation Source # | |
type Rep ExeInfo Source # | |
Defined in System.MemInfo.Proc type Rep ExeInfo = D1 ('MetaData "ExeInfo" "System.MemInfo.Proc" "mem-info-0.1.0.0-inplace" 'False) (C1 ('MetaCons "ExeInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "eiTarget") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "eiOriginal") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "eiDeleted") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)))) |
Parse /proc/<pid>/status
parseStatusInfo :: Text -> Either BadStatus StatusInfo Source #
Parses the content of /proc/<pid>/status into a StatusInfo
data StatusInfo Source #
Represents the information about a process obtained from procpid/status
Instances
Generic StatusInfo Source # | |
Defined in System.MemInfo.Proc from :: StatusInfo -> Rep StatusInfo x Source # to :: Rep StatusInfo x -> StatusInfo Source # | |
Show StatusInfo Source # | |
Defined in System.MemInfo.Proc | |
Eq StatusInfo Source # | |
Defined in System.MemInfo.Proc (==) :: StatusInfo -> StatusInfo -> Bool Source # (/=) :: StatusInfo -> StatusInfo -> Bool Source # | |
Validity StatusInfo Source # | |
Defined in System.MemInfo.Proc validate :: StatusInfo -> Validation Source # | |
type Rep StatusInfo Source # | |
Defined in System.MemInfo.Proc type Rep StatusInfo = D1 ('MetaData "StatusInfo" "System.MemInfo.Proc" "mem-info-0.1.0.0-inplace" 'False) (C1 ('MetaCons "StatusInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "siName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "siParent") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProcessID))) |