Class ProcSelfCgroupDiscoverer
java.lang.Object
org.apache.druid.java.util.metrics.cgroups.ProcSelfCgroupDiscoverer
- All Implemented Interfaces:
CgroupDiscoverer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CgroupDiscovererstatic CgroupDiscovererautoCgroupDiscoverer(Path procPidDir) Creates the appropriate CgroupDiscoverer based on the cgroups version detected in the system.Returns a path for a specific cgroup.Gets CPU metrics (shares, quota, period, usage) appropriate for this cgroups version.Gets CPU set metrics (effective CPU list) appropriate for this cgroups version.
-
Constructor Details
-
ProcSelfCgroupDiscoverer
public ProcSelfCgroupDiscoverer() -
ProcSelfCgroupDiscoverer
-
-
Method Details
-
autoCgroupDiscoverer
-
discover
Description copied from interface:CgroupDiscovererReturns a path for a specific cgroup. This path should contain the interesting cgroup files without further traversing needed.- Specified by:
discoverin interfaceCgroupDiscoverer- Parameters:
cgroup- The cgroup- Returns:
- The path that contains that cgroup's interesting bits.
-
getCpuMetrics
Description copied from interface:CgroupDiscovererGets CPU metrics (shares, quota, period, usage) appropriate for this cgroups version. Encapsulates the difference between v1 (cpu.shares, cpu.cfs_*) and v2 (cpu.weight, cpu.max).- Specified by:
getCpuMetricsin interfaceCgroupDiscoverer- Returns:
- CPU metrics compatible with both cgroups v1 and v2
-
getCpuSetMetrics
Description copied from interface:CgroupDiscovererGets CPU set metrics (effective CPU list) appropriate for this cgroups version. Encapsulates the difference between v1 (cpuset.effective_cpus) and v2 (cpuset.cpus.effective).- Specified by:
getCpuSetMetricsin interfaceCgroupDiscoverer- Returns:
- CPU set metrics compatible with both cgroups v1 and v2
-
getCgroupVersion
- Specified by:
getCgroupVersionin interfaceCgroupDiscoverer
-
autoCgroupDiscoverer
Creates the appropriate CgroupDiscoverer based on the cgroups version detected in the system.
-