< prev index next >

test/jdk/jdk/internal/platform/cgroup/TestCgroupMetrics.java

Print this page
@  rev 56863 : 8231111: Cgroups v2: Rework Metrics in java.base so as to recognize unified hierarchy
|  Reviewed-by: bobv
~


  26  * @requires os.family == "linux"
  27  * @modules java.base/jdk.internal.platform
  28  * @library /test/lib
  29  * @run main TestCgroupMetrics
  30  */
  31 
  32 import jdk.test.lib.containers.cgroup.MetricsTester;
  33 import jdk.internal.platform.Metrics;
  34 
  35 public class TestCgroupMetrics {
  36 
  37     public static void main(String[] args) throws Exception {
  38         // If cgroups is not configured, report success.
  39         Metrics metrics = Metrics.systemMetrics();
  40         if (metrics == null) {
  41             System.out.println("TEST PASSED!!!");
  42             return;
  43         }
  44 
  45         MetricsTester metricsTester = new MetricsTester();
  46         metricsTester.setup();
  47         metricsTester.testCpuAccounting();
  48         metricsTester.testCpuSchedulingMetrics();
  49         metricsTester.testCpuSets();
  50         metricsTester.testMemorySubsystem();
  51         metricsTester.testBlkIO();
  52         metricsTester.testCpuConsumption();
  53         metricsTester.testMemoryUsage();
  54         System.out.println("TEST PASSED!!!");
  55     }
  56 
  57 }


  26  * @requires os.family == "linux"
  27  * @modules java.base/jdk.internal.platform
  28  * @library /test/lib
  29  * @run main TestCgroupMetrics
  30  */
  31 
  32 import jdk.test.lib.containers.cgroup.MetricsTester;
  33 import jdk.internal.platform.Metrics;
  34 
  35 public class TestCgroupMetrics {
  36 
  37     public static void main(String[] args) throws Exception {
  38         // If cgroups is not configured, report success.
  39         Metrics metrics = Metrics.systemMetrics();
  40         if (metrics == null) {
  41             System.out.println("TEST PASSED!!!");
  42             return;
  43         }
  44 
  45         MetricsTester metricsTester = new MetricsTester();
  46         metricsTester.testAll(metrics);







  47         System.out.println("TEST PASSED!!!");
  48     }
  49 
  50 }
< prev index next >