author | akulyakh |
Thu, 14 Jan 2016 15:35:21 +0300 | |
changeset 35493 | 863fb33f9940 |
child 43933 | 85ee551f3948 |
permissions | -rw-r--r-- |
35493
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
1 |
/* |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
2 |
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
4 |
* |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
8 |
* |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
13 |
* accompanied this code). |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
14 |
* |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
18 |
* |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
21 |
* questions. |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
22 |
*/ |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
23 |
package utils; |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
24 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
25 |
import common.ToolResults; |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
26 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
27 |
/** |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
28 |
* Results of running the jstat tool Concrete subclasses will detail the jstat |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
29 |
* tool options |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
30 |
*/ |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
31 |
abstract public class JstatResults extends ToolResults { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
32 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
33 |
public JstatResults(ToolResults rawResults) { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
34 |
super(rawResults); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
35 |
} |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
36 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
37 |
/** |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
38 |
* Gets a string result from the column labeled 'name' |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
39 |
* |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
40 |
* @param name - name of the column |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
41 |
* @return the result |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
42 |
*/ |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
43 |
public String getStringValue(String name) { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
44 |
int valueNdx = new StringOfValues(getStdoutLine(0)).getIndex(name); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
45 |
return new StringOfValues(getStdoutLine(1)).getValue(valueNdx); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
46 |
} |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
47 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
48 |
/** |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
49 |
* Gets a float result from the column labeled 'name' |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
50 |
* |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
51 |
* @param name - name of the column |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
52 |
* @return the result |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
53 |
*/ |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
54 |
public float getFloatValue(String name) { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
55 |
int valueNdx = new StringOfValues(getStdoutLine(0)).getIndex(name); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
56 |
return Float.valueOf(new StringOfValues(getStdoutLine(1)).getValue(valueNdx)); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
57 |
} |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
58 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
59 |
/** |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
60 |
* Gets an integer result from the column labeled 'name' |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
61 |
* |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
62 |
* @param name - name of the column |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
63 |
* @return the result |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
64 |
*/ |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
65 |
public int getIntValue(String name) { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
66 |
int valueNdx = new StringOfValues(getStdoutLine(0)).getIndex(name); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
67 |
return Integer.valueOf(new StringOfValues(getStdoutLine(1)).getValue(valueNdx)); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
68 |
} |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
69 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
70 |
/** |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
71 |
* Checks if a column with a given name exists |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
72 |
* |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
73 |
* @param name - name of the column |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
74 |
* @return true if the column exist, false otherwise |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
75 |
*/ |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
76 |
public boolean valueExists(String name) { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
77 |
return new StringOfValues(getStdoutLine(0)).getIndex(name) != -1; |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
78 |
} |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
79 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
80 |
/** |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
81 |
* Helper function to assert the increase of the GC events between 2 |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
82 |
* measurements |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
83 |
* |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
84 |
* @param measurement1 -first measurement |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
85 |
* @param measurement2 -first measurement |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
86 |
*/ |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
87 |
public static void assertGCEventsIncreased(JstatResults measurement1, JstatResults measurement2) { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
88 |
assertThat(measurement2.getFloatValue("YGC") > measurement1.getFloatValue("YGC"), "YGC didn't increase between measurements 1 and 2"); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
89 |
assertThat(measurement2.getFloatValue("FGC") > measurement1.getFloatValue("FGC"), "FGC didn't increase between measurements 2 and 3"); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
90 |
} |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
91 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
92 |
/** |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
93 |
* Helper function to assert the increase of the GC time between 2 |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
94 |
* measurements |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
95 |
* |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
96 |
* @param measurement1 -first measurement |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
97 |
* @param measurement2 -first measurement |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
98 |
*/ |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
99 |
public static void assertGCTimeIncreased(JstatResults measurement1, JstatResults measurement2) { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
100 |
assertThat(measurement2.getFloatValue("YGCT") > measurement1.getFloatValue("YGCT"), "YGCT time didn't increase between measurements 1 and 2"); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
101 |
assertThat(measurement2.getFloatValue("FGCT") > measurement1.getFloatValue("FGCT"), "FGCT time didn't increase between measurements 1 and 2"); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
102 |
assertThat(measurement2.getFloatValue("GCT") > measurement1.getFloatValue("GCT"), "GCT time didn't increase between measurements 1 and 2"); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
103 |
} |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
104 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
105 |
/** |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
106 |
* Helper function to assert the utilization of the space |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
107 |
* |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
108 |
* @param measurement - measurement results to analyze |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
109 |
* @param targetMemoryUsagePercent -assert that not less than this amount of |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
110 |
* space has been utilized |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
111 |
*/ |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
112 |
public static void assertSpaceUtilization(JstatResults measurement, float targetMemoryUsagePercent) { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
113 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
114 |
if (measurement.valueExists("OU")) { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
115 |
float OC = measurement.getFloatValue("OC"); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
116 |
float OU = measurement.getFloatValue("OU"); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
117 |
assertThat((OU / OC) > targetMemoryUsagePercent, "Old space utilization should be > " |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
118 |
+ (targetMemoryUsagePercent * 100) + "%, actually OU / OC = " + (OU / OC)); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
119 |
} |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
120 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
121 |
if (measurement.valueExists("MU")) { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
122 |
float MC = measurement.getFloatValue("MC"); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
123 |
float MU = measurement.getFloatValue("MU"); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
124 |
assertThat((MU / MC) > targetMemoryUsagePercent, "Metaspace utilization should be > " |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
125 |
+ (targetMemoryUsagePercent * 100) + "%, actually MU / MC = " + (MU / MC)); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
126 |
} |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
127 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
128 |
if (measurement.valueExists("O")) { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
129 |
float O = measurement.getFloatValue("O"); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
130 |
assertThat(O > targetMemoryUsagePercent * 100, "Old space utilization should be > " |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
131 |
+ (targetMemoryUsagePercent * 100) + "%, actually O = " + O); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
132 |
} |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
133 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
134 |
if (measurement.valueExists("M")) { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
135 |
float M = measurement.getFloatValue("M"); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
136 |
assertThat(M > targetMemoryUsagePercent * 100, "Metaspace utilization should be > " |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
137 |
+ (targetMemoryUsagePercent * 100) + "%, actually M = " + M); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
138 |
} |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
139 |
} |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
140 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
141 |
private static void assertThat(boolean result, String message) { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
142 |
if (!result) { |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
143 |
throw new RuntimeException(message); |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
144 |
} |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
145 |
} |
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
146 |
|
863fb33f9940
8130063: Refactoring tmtools jstat and jstack tests to jtreg
akulyakh
parents:
diff
changeset
|
147 |
} |