Sys.Linux.Cgroup.V2.Config (Hyper v0.1.0)

Copy Markdown View Source

Map which represents the possible configurations of a cgroup

Summary

Functions

Render the config into cgroup v2 interface-file => value pairs.

Types

cpu_spec()

@type cpu_spec() :: %{quota_us: pos_integer(), period_us: pos_integer()}

linux_t()

@type linux_t() :: %{
  optional(:"cpu.max") => String.t(),
  optional(:"memory.max") => String.t()
}

t()

@type t() :: %{
  optional(:cpu_max) => cpu_spec(),
  optional(:memory_max) => pos_integer()
}

Functions

as_linux(cfg)

@spec as_linux(t()) :: linux_t()

Render the config into cgroup v2 interface-file => value pairs.

cpu_max(cfg, quota_us, period_us)

@spec cpu_max(t(), pos_integer(), pos_integer()) :: t()

memory_max(cfg, val)

@spec memory_max(t(), pos_integer()) :: t()

new()

@spec new() :: t()