113
114 private static String phaseRegex(String phaseName) {
115 final String timeRegex = doubleRegex + "ms";
116 return indent(6) + phaseName + ": " + timeRegex + "\n";
117 }
118
119 private static String subphaseRegex(String subphaseName, boolean parallelRefProcEnabled) {
120 final String timeRegex = "\\s+" + doubleRegex;
121 if (parallelRefProcEnabled) {
122 final String timeInParRegex = timeRegex +",\\s";
123 return gcLogTimeRegex + indent(8) + subphaseName +
124 " \\(ms\\):\\s+(Min:" + timeInParRegex + "Avg:" + timeInParRegex + "Max:" + timeInParRegex + "Diff:" + t
125 "Workers: [0-9]+|skipped)" + "\n";
126 } else {
127 return gcLogTimeRegex + indent(8) + subphaseName + ":(" + timeRegex + "ms|\\s+skipped)\n";
128 }
129 }
130
131 // Find the first Reference Processing log and check its format.
132 private static void checkLogFormat(OutputAnalyzer output, boolean parallelRefProcEnabled) {
133 String countRegex = "[0-9]+";
134 String timeRegex = doubleRegex + "ms";
135
136 /* Total Reference processing time */
137 String totalRegex = gcLogTimeRegex + indent(4) + referenceProcessing + ": " + timeRegex + "\n";
138
139 String balanceRegex = parallelRefProcEnabled ? "(" + gcLogTimeRegex + indent(8) + "Balance queues: " + timeRegex +
140
141 final boolean p = parallelRefProcEnabled;
142
143 String phase1Regex = gcLogTimeRegex + phaseRegex(phaseReconsiderSoftReferences) + balanceRegex + subphaseRegex("Sof
144 String phase2Regex = gcLogTimeRegex + phaseRegex(phaseNotifySoftWeakReferences) +
145 balanceRegex +
146 subphaseRegex("SoftRef", p) +
147 subphaseRegex("WeakRef", p) +
148 subphaseRegex("FinalRef", p) +
149 subphaseRegex("Total", p);
150 String phase3Regex = gcLogTimeRegex + phaseRegex(phaseNotifyKeepAliveFinalizer) + balanceRegex + subphaseRegex("Fin
151 String phase4Regex = gcLogTimeRegex + phaseRegex(phaseNotifyPhantomReferences) + balanceRegex + subphaseRegex("Phan
152
|
113
114 private static String phaseRegex(String phaseName) {
115 final String timeRegex = doubleRegex + "ms";
116 return indent(6) + phaseName + ": " + timeRegex + "\n";
117 }
118
119 private static String subphaseRegex(String subphaseName, boolean parallelRefProcEnabled) {
120 final String timeRegex = "\\s+" + doubleRegex;
121 if (parallelRefProcEnabled) {
122 final String timeInParRegex = timeRegex +",\\s";
123 return gcLogTimeRegex + indent(8) + subphaseName +
124 " \\(ms\\):\\s+(Min:" + timeInParRegex + "Avg:" + timeInParRegex + "Max:" + timeInParRegex + "Diff:" + t
125 "Workers: [0-9]+|skipped)" + "\n";
126 } else {
127 return gcLogTimeRegex + indent(8) + subphaseName + ":(" + timeRegex + "ms|\\s+skipped)\n";
128 }
129 }
130
131 // Find the first Reference Processing log and check its format.
132 private static void checkLogFormat(OutputAnalyzer output, boolean parallelRefProcEnabled) {
133 String timeRegex = doubleRegex + "ms";
134
135 /* Total Reference processing time */
136 String totalRegex = gcLogTimeRegex + indent(4) + referenceProcessing + ": " + timeRegex + "\n";
137
138 String balanceRegex = parallelRefProcEnabled ? "(" + gcLogTimeRegex + indent(8) + "Balance queues: " + timeRegex +
139
140 final boolean p = parallelRefProcEnabled;
141
142 String phase1Regex = gcLogTimeRegex + phaseRegex(phaseReconsiderSoftReferences) + balanceRegex + subphaseRegex("Sof
143 String phase2Regex = gcLogTimeRegex + phaseRegex(phaseNotifySoftWeakReferences) +
144 balanceRegex +
145 subphaseRegex("SoftRef", p) +
146 subphaseRegex("WeakRef", p) +
147 subphaseRegex("FinalRef", p) +
148 subphaseRegex("Total", p);
149 String phase3Regex = gcLogTimeRegex + phaseRegex(phaseNotifyKeepAliveFinalizer) + balanceRegex + subphaseRegex("Fin
150 String phase4Regex = gcLogTimeRegex + phaseRegex(phaseNotifyPhantomReferences) + balanceRegex + subphaseRegex("Phan
151
|