Class CpuSet
java.lang.Object
org.apache.druid.java.util.metrics.cgroups.CpuSet
Collect CPU and memory data from cpuset cgroup files.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]Parses the cpuset list format and outputs it as a list of CPUs.snapshot()Take a snapshot of cpuset cgroup data
-
Constructor Details
-
CpuSet
-
-
Method Details
-
snapshot
Take a snapshot of cpuset cgroup data- Returns:
- A snapshot with the data populated.
-
parseStringRangeToIntArray
Parses the cpuset list format and outputs it as a list of CPUs. Examples: 0-4,9 # bits 0, 1, 2, 3, 4, and 9 set # outputs [0, 1, 2, 3, 4, 9] 0-2,7,12-14 # bits 0, 1, 2, 7, 12, 13, and 14 set # outputs [0, 1, 2, 7, 12, 13, 14] This method also works fine for memory nodes. The format is identical in both cgroups v1 and v2, so this can be shared.- Parameters:
line- The list format cpu value- Returns:
- the list of CPU IDs
-