< prev index next >

test/jdk/jdk/internal/platform/docker/TestDockerCpuMetrics.java

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

*** 1,7 **** /* ! * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 76,89 **** testCpuThrottling(0.5);// --cpus=<value> int[] cpuSetMems = Metrics.systemMetrics().getCpuSetMems(); String memNodes = null; ! if (cpuSetMems.length > 1) { int endNode = (cpuSetMems[cpuSetMems.length - 1] - cpuSetMems[0]) / 2 + cpuSetMems[0]; memNodes = cpuSetMems[0] + "-" + endNode; ! } else if (cpuSetMems.length == 1) { memNodes = cpuSetMems[0] + ""; } if(memNodes != null) testCpuSetMems(memNodes); --- 76,89 ---- testCpuThrottling(0.5);// --cpus=<value> int[] cpuSetMems = Metrics.systemMetrics().getCpuSetMems(); String memNodes = null; ! if (cpuSetMems != null && cpuSetMems.length > 1) { int endNode = (cpuSetMems[cpuSetMems.length - 1] - cpuSetMems[0]) / 2 + cpuSetMems[0]; memNodes = cpuSetMems[0] + "-" + endNode; ! } else if (cpuSetMems != null && cpuSetMems.length == 1) { memNodes = cpuSetMems[0] + ""; } if(memNodes != null) testCpuSetMems(memNodes);
< prev index next >