Class ProcSelfCgroupDiscoverer

java.lang.Object
org.apache.druid.java.util.metrics.cgroups.ProcSelfCgroupDiscoverer
All Implemented Interfaces:
CgroupDiscoverer

public class ProcSelfCgroupDiscoverer extends Object implements CgroupDiscoverer
  • Constructor Details

    • ProcSelfCgroupDiscoverer

      public ProcSelfCgroupDiscoverer()
    • ProcSelfCgroupDiscoverer

      public ProcSelfCgroupDiscoverer(Class<? extends CgroupDiscoverer> discoverer)
  • Method Details

    • autoCgroupDiscoverer

      public static CgroupDiscoverer autoCgroupDiscoverer()
    • discover

      public Path discover(String cgroup)
      Description copied from interface: CgroupDiscoverer
      Returns a path for a specific cgroup. This path should contain the interesting cgroup files without further traversing needed.
      Specified by:
      discover in interface CgroupDiscoverer
      Parameters:
      cgroup - The cgroup
      Returns:
      The path that contains that cgroup's interesting bits.
    • getCpuMetrics

      public Cpu.CpuMetrics getCpuMetrics()
      Description copied from interface: CgroupDiscoverer
      Gets 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:
      getCpuMetrics in interface CgroupDiscoverer
      Returns:
      CPU metrics compatible with both cgroups v1 and v2
    • getCpuSetMetrics

      public CpuSet.CpuSetMetric getCpuSetMetrics()
      Description copied from interface: CgroupDiscoverer
      Gets 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:
      getCpuSetMetrics in interface CgroupDiscoverer
      Returns:
      CPU set metrics compatible with both cgroups v1 and v2
    • getCgroupVersion

      public CgroupVersion getCgroupVersion()
      Specified by:
      getCgroupVersion in interface CgroupDiscoverer
    • autoCgroupDiscoverer

      public static CgroupDiscoverer autoCgroupDiscoverer(Path procPidDir)
      Creates the appropriate CgroupDiscoverer based on the cgroups version detected in the system.