Class CgroupCpuMonitor

All Implemented Interfaces:
Monitor

public class CgroupCpuMonitor extends FeedDefiningMonitor
  • Constructor Details

  • Method Details

    • doMonitor

      public boolean doMonitor(ServiceEmitter emitter)
      Specified by:
      doMonitor in class AbstractMonitor
    • 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.