cgroup-rts-threads-0.2.1.1: A container-/cgroup-aware substitute for the GHC RTS `-N` flag
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.CGroup.Types

Description

Parsers and types related to cgroups and mounts

Synopsis

CPU quotas

data CPUQuota Source #

A CPU quota is the ratio of CPU time our process can use relative to the scheduler period

For example:

| ratio            | description |
| ---------------- | ----------- |
|  100000 / 100000 |         (1) |
|  200000 / 100000 |         (2) |
|   50000 / 100000 |         (3) |
|     max / 100000 |         (4) |
  1. : we can use up to a single CPU core
  2. : we can use up to two CPU cores
  3. : the scheduler will give us a single CPU core for up to 50% of the time
  4. : we can use all available CPU resources (there is no quota)

Constructors

CPUQuota (Ratio Int) 
NoQuota 

Instances

Instances details
Show CPUQuota Source # 
Instance details

Defined in System.CGroup.Types

Eq CPUQuota Source # 
Instance details

Defined in System.CGroup.Types

Ord CPUQuota Source # 
Instance details

Defined in System.CGroup.Types

raw cgroups as viewed in /proc/$PID/cgroup

data RawCGroup Source #

A cgroup, as viewed within /proc/[pid]/cgroup

see cgroups(7): /proc/[pid]/cgroup section

Instances

Instances details
Show RawCGroup Source # 
Instance details

Defined in System.CGroup.Types

parseCGroups :: Parser [RawCGroup] Source #

Parse an entire /proc/[pid]/cgroup file into a list of cgroups

mounts as viewed in /proc/$PID/mountinfo

data Mount Source #

A mount, as viewed within /proc/[pid]/mountinfo

see proc(5): /proc/[pid]/mountinfo section

Instances

Instances details
Show Mount Source # 
Instance details

Defined in System.CGroup.Types

Methods

showsPrec :: Int -> Mount -> ShowS #

show :: Mount -> String #

showList :: [Mount] -> ShowS #

parseMountInfo :: Parser [Mount] Source #

Parse an entire /proc/[pid]/mountinfo file into a list of mounts

Parser type

type Parser = Parsec Void Text Source #

Megaparsec Parser

parseFile :: Parser a -> Path b File -> IO a Source #

Parse a file