Modules§
Structs§
- Cgroups
Metrics Collector - A collector that collects cgroups metrics.
- Resource
Stat Impl - A implementation of
ResourceStattrait.
Traits§
- Resource
Stat - A trait for getting resource statistics.
Functions§
- get_
cpu_ limit_ from_ cgroups - Get the limit of cpu in millicores from cgroups filesystem.
- get_
cpu_ usage_ from_ cgroups - Get the usage of cpu in millicores from cgroups filesystem.
- get_
memory_ limit_ from_ cgroups - Get the limit of memory in bytes from cgroups filesystem.
- get_
memory_ usage_ from_ cgroups - Get the usage of memory in bytes from cgroups filesystem.
- get_
total_ cpu_ cores - Get the total CPU cores. The result will be rounded to the nearest integer. For example, if the total CPU is 1.5 cores(1500 millicores), the result will be 2.
- get_
total_ cpu_ millicores - Get the total CPU in millicores. If the CPU limit is unset, it will return the total CPU cores from host system.
- get_
total_ memory_ bytes - Get the total memory in bytes. If the memory limit is unset, it will return the total memory from host system. If the system is not supported to get the total host memory, it will return 0.
- get_
total_ memory_ readable - Get the total memory in readable size.
Type Aliases§
- Resource
Stat Ref - A reference to a
ResourceStatimplementation.