Class CgroupUtil

java.lang.Object
org.apache.druid.java.util.metrics.CgroupUtil

public class CgroupUtil extends Object
  • Field Details

  • Constructor Details

    • CgroupUtil

      public CgroupUtil()
  • Method Details

    • readLongValue

      public static long readLongValue(CgroupDiscoverer discoverer, String cgroup, String fileName, long defaultValue)
    • computeProcessorQuota

      public static double computeProcessorQuota(long quotaUs, long periodUs)
      Calculates the total cores allocated through quotas. A negative value indicates that no quota has been specified. We use -1 because that's the default value used in the cgroup.
      Parameters:
      quotaUs - the cgroup quota value.
      periodUs - the cgroup period value.
      Returns:
      the calculated processor quota, -1 if no quota or period set.