Copyright | (c) 2022 Tim Emiola |
---|---|
License | BSD3 |
Maintainer | Tim Emiola <adetokunbo@emio.la> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
System.MemInfo.Proc
Description
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
Constructors
MemUsage | |
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
Constructors
ProcUsage | |
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
Constructors
ExeInfo | |
Instances
Generic ExeInfo Source # | |
Show ExeInfo Source # | |
Eq ExeInfo Source # | |
Validity ExeInfo Source # | |
Defined in System.MemInfo.Proc Methods 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
Constructors
StatusInfo | |
Instances
Generic StatusInfo Source # | |
Defined in System.MemInfo.Proc | |
Show StatusInfo Source # | |
Defined in System.MemInfo.Proc | |
Eq StatusInfo Source # | |
Defined in System.MemInfo.Proc Methods (==) :: StatusInfo -> StatusInfo -> Bool Source # (/=) :: StatusInfo -> StatusInfo -> Bool Source # | |
Validity StatusInfo Source # | |
Defined in System.MemInfo.Proc Methods 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))) |