Crate common_stat

Crate common_stat 

Source

Modules§

cgroups 🔒
resource 🔒

Structs§

CgroupsMetricsCollector
A collector that collects cgroups metrics.
ResourceStatImpl
A implementation of ResourceStat trait.

Traits§

ResourceStat
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§

ResourceStatRef
A reference to a ResourceStat implementation.