Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Parsers and types related to cgroups and mounts
Synopsis
- data CPUQuota
- data RawCGroup = RawCGroup {
- rawCGroupId :: Text
- rawCGroupControllers :: [Text]
- rawCGroupPath :: Path Abs Dir
- parseCGroups :: Parser [RawCGroup]
- data Mount = Mount {
- mountId :: Text
- mountParentId :: Text
- mountStDev :: Text
- mountRoot :: Text
- mountPoint :: Text
- mountOptions :: Text
- mountTags :: [Text]
- mountFilesystemType :: Text
- mountSource :: Text
- mountSuperOptions :: [Text]
- parseMountInfo :: Parser [Mount]
- type Parser = Parsec Void Text
- parseFile :: Parser a -> Path b File -> IO a
CPU quotas
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) |
- : we can use up to a single CPU core
- : we can use up to two CPU cores
- : the scheduler will give us a single CPU core for up to 50% of the time
- : we can use all available CPU resources (there is no quota)
raw cgroups as viewed in /proc/$PID/cgroup
A cgroup, as viewed within /proc/[pid]/cgroup
see cgroups(7): /proc/[pid]/cgroup section
RawCGroup | |
|
parseCGroups :: Parser [RawCGroup] Source #
Parse an entire /proc/[pid]/cgroup file into a list of cgroups
mounts as viewed in /proc/$PID/mountinfo
A mount, as viewed within /proc/[pid]/mountinfo
see proc(5): /proc/[pid]/mountinfo section
Mount | |
|
parseMountInfo :: Parser [Mount] Source #
Parse an entire /proc/[pid]/mountinfo file into a list of mounts