|
16 | 16 | import com.tagtraum.perf.gcviewer.UnittestHelper.FOLDER; |
17 | 17 | import com.tagtraum.perf.gcviewer.model.AbstractGCEvent; |
18 | 18 | import com.tagtraum.perf.gcviewer.model.AbstractGCEvent.Type; |
19 | | -import com.tagtraum.perf.gcviewer.util.DateHelper; |
20 | 19 | import com.tagtraum.perf.gcviewer.model.GCModel; |
21 | 20 | import com.tagtraum.perf.gcviewer.model.GCResource; |
22 | 21 | import com.tagtraum.perf.gcviewer.model.GcResourceFile; |
| 22 | +import com.tagtraum.perf.gcviewer.util.DateHelper; |
23 | 23 | import org.junit.Test; |
24 | 24 |
|
25 | 25 | /** |
@@ -221,86 +221,6 @@ public void shenandoahPauseUpdateRefs() throws Exception { |
221 | 221 | assertThat("Pause Final Update Refs: duration", finalUpdateRefsEvent.getPause(), closeTo(0.000291, 0.00001)); |
222 | 222 | } |
223 | 223 |
|
224 | | -// FIX ME! Only "Concurrent cleanup", "Concurrent uncommit", "Pause Degenerated GC", "Pause Full" event types have memory info |
225 | | -// @Test |
226 | | -// public void shehandoahConcurrentEventsjsk8u171() throws Exception { |
227 | | -// // FIX ME! I think the test is overtime and need removed, alert the log string for build success. |
228 | | -// // probably jdk8u171 |
229 | | -// TestLogHandler handler = new TestLogHandler(); |
230 | | -// handler.setLevel(Level.WARNING); |
231 | | -// GCResource gcResource = new GcResourceFile("byteArray"); |
232 | | -// gcResource.getLogger().addHandler(handler); |
233 | | -// |
234 | | -// ByteArrayInputStream in = new ByteArrayInputStream( |
235 | | -// ("13.979: [Concurrent marking 1435M->1447M(2048M), 12.576 ms]" + |
236 | | -// "\n13.994: [Concurrent evacuation 684M->712M(2048M), 6.041 ms]" + |
237 | | -// "\n14.001: [Concurrent update references 713M->726M(2048M), 14.718 ms]" + |
238 | | -// "\n14.017: [Concurrent reset bitmaps 60M->62M(2048M), 0.294 ms]" + |
239 | | -// "\n626.259: [Cancel concurrent mark, 0.056 ms]\n") |
240 | | -// .getBytes()); |
241 | | -// |
242 | | -// DataReader reader = new DataReaderSun1_6_0(gcResource, in, GcLogType.SUN1_8); |
243 | | -// GCModel model = reader.read(); |
244 | | -// |
245 | | -// assertThat("gc count", model.size(), is(5)); |
246 | | -// assertThat("warnings", handler.getCount(), is(0)); |
247 | | -// |
248 | | -// AbstractGCEvent<?> concurrentMarking = model.get(0); |
249 | | -// assertThat("Concurrent Marking: name", concurrentMarking.getTypeAsString(), equalTo("Concurrent marking")); |
250 | | -// assertThat("Concurrent Marking: duration", concurrentMarking.getPause(), closeTo(0.012576, 0.0000001)); |
251 | | -// assertThat("Concurrent Marking: before", concurrentMarking.getPreUsed(), is(1435 * 1024)); |
252 | | -// assertThat("Concurrent Marking: after", concurrentMarking.getPostUsed(), is(1447 * 1024)); |
253 | | -// assertThat("Concurrent Marking: total", concurrentMarking.getTotal(), is(2048 * 1024)); |
254 | | -// } |
255 | | -// |
256 | | -// @Test |
257 | | -// public void shehandoahConcurrentEventsjsk8u232() throws Exception { |
258 | | -// TestLogHandler handler = new TestLogHandler(); |
259 | | -// handler.setLevel(Level.WARNING); |
260 | | -// GCResource gcResource = new GcResourceFile("byteArray"); |
261 | | -// gcResource.getLogger().addHandler(handler); |
262 | | -// |
263 | | -// ByteArrayInputStream in = new ByteArrayInputStream( |
264 | | -// ("0.233: [Concurrent reset, start]\n" + |
265 | | -// " Using 2 of 2 workers for concurrent reset\n" + |
266 | | -// "0.234: [Concurrent reset 32854K->32983K(34816K), 0.401 ms]\n" + |
267 | | -// "0.237: [Concurrent marking (process weakrefs), start]\n" + |
268 | | -// " Using 2 of 2 workers for concurrent marking\n" + |
269 | | -// "0.238: [Concurrent marking (process weakrefs) 32983K->34327K(36864K), 1.159 ms]\n" + |
270 | | -// "0.238: [Concurrent precleaning, start]\n" + |
271 | | -// " Using 1 of 2 workers for concurrent preclean\n" + |
272 | | -// "0.238: [Concurrent precleaning 34359K->34423K(36864K), 0.053 ms]\n" + |
273 | | -// "0.242: [Concurrent cleanup, start]\n" + |
274 | | -// "0.242: [Concurrent cleanup 34807K->34840K(36864K), 0.019 ms]\n" + |
275 | | -// "Free: 78M (56 regions), Max regular: 2048K, Max humongous: 61440K, External frag: 24%, Internal frag: 29%\n" + |
276 | | -// "Evacuation Reserve: 7M (4 regions), Max regular: 2048K\n" + |
277 | | -// "0.298: [Concurrent evacuation, start]\n" + |
278 | | -// " Using 2 of 2 workers for concurrent evacuation\n" + |
279 | | -// "0.299: [Concurrent evacuation 42458K->46621K(112M), 0.538 ms]\n" + |
280 | | -// "0.299: [Concurrent update references, start]\n" + |
281 | | -// " Using 2 of 2 workers for concurrent reference update\n" + |
282 | | -// "0.299: [Concurrent update references 46813K->49951K(112M), 0.481 ms]\n" + |
283 | | -// "Free: 118M (60 regions), Max regular: 2048K, Max humongous: 110592K, External frag: 9%, Internal frag: 1%\n" + |
284 | | -// "Evacuation Reserve: 8M (4 regions), Max regular: 2048K\n" + |
285 | | -// "Pacer for Idle. Initial: 2M, Alloc Tax Rate: 1.0x\n" + |
286 | | -// "1.115: [Concurrent uncommit, start]\n" + |
287 | | -// "1.129: [Concurrent uncommit 1986K->1986K(10240K), 13.524 ms]\n") |
288 | | -// .getBytes()); |
289 | | -// |
290 | | -// DataReader reader = new DataReaderSun1_6_0(gcResource, in, GcLogType.SUN1_8); |
291 | | -// GCModel model = reader.read(); |
292 | | -// |
293 | | -// assertThat("gc count", model.size(), is(7)); |
294 | | -// assertThat("warnings", handler.getCount(), is(0)); |
295 | | -// |
296 | | -// AbstractGCEvent<?> concurrentMarking = model.get(0); |
297 | | -// assertThat("Concurrent reset: name", concurrentMarking.getTypeAsString(), is("Concurrent reset")); |
298 | | -// assertThat("Concurrent reset: duration", concurrentMarking.getPause(), closeTo(0.000401, 0.0000001)); |
299 | | -// assertThat("Concurrent reset: before", concurrentMarking.getPreUsed(), is(32854)); |
300 | | -// assertThat("Concurrent reset: after", concurrentMarking.getPostUsed(), is(32983)); |
301 | | -// assertThat("Concurrent reset: total", concurrentMarking.getTotal(), is(34816)); |
302 | | -// } |
303 | | - |
304 | 224 | @Test |
305 | 225 | public void shenandoahIgnoredLines() throws Exception { |
306 | 226 | TestLogHandler handler = new TestLogHandler(); |
@@ -394,46 +314,6 @@ public void shenandoahDetailsShutdown() throws Exception { |
394 | 314 | is(1L)); |
395 | 315 | } |
396 | 316 |
|
397 | | -// FIX ME! Only "Concurrent cleanup", "Concurrent uncommit", "Pause Degenerated GC", "Pause Full" event types have memory info |
398 | | -// @Test |
399 | | -// public void shenandoah_171_Beginning() throws Exception { |
400 | | -// // in its early implementation (jdk8u171), Shenandoah had memory information in the "Pause Final Mark" event, which was dropped later (jdk8u232) |
401 | | -// TestLogHandler handler = new TestLogHandler(); |
402 | | -// handler.setLevel(Level.INFO); |
403 | | -// GCResource gcResource = new GcResourceFile("SampleOpenJdk1_8_0-171-ShenandoahBeginning.txt"); |
404 | | -// gcResource.getLogger().addHandler(handler); |
405 | | -// |
406 | | -// DataReader reader = getDataReader(gcResource); |
407 | | -// GCModel model = reader.read(); |
408 | | -// |
409 | | -// assertThat("gc count", model.size(), is(3)); |
410 | | -// assertThat("number of errors", |
411 | | -// handler.getLogRecords().stream().filter(logRecord -> !logRecord.getLevel().equals(Level.INFO)).count(), |
412 | | -// is(2L)); |
413 | | -// assertThat("contains 'Initialize Shenandoah heap'", |
414 | | -// handler.getLogRecords().stream().filter(logRecord -> logRecord.getMessage().startsWith("Initialize Shenandoah heap")).count(), |
415 | | -// is(1L)); |
416 | | -// } |
417 | | -// |
418 | | -// @Test |
419 | | -// public void shenandoah_232_Beginning() throws Exception { |
420 | | -// TestLogHandler handler = new TestLogHandler(); |
421 | | -// handler.setLevel(Level.INFO); |
422 | | -// GCResource gcResource = new GcResourceFile("SampleOpenJdk1_8_0-232-ShenandoahBeginning.txt"); |
423 | | -// gcResource.getLogger().addHandler(handler); |
424 | | -// |
425 | | -// DataReader reader = getDataReader(gcResource); |
426 | | -// GCModel model = reader.read(); |
427 | | -// |
428 | | -// assertThat("gc count", model.size(), is(0)); |
429 | | -// assertThat("number of errors", |
430 | | -// handler.getLogRecords().stream().filter(logRecord -> !logRecord.getLevel().equals(Level.INFO)).count(), |
431 | | -// is(0L)); |
432 | | -// assertThat("contains 'Shenandoah heuristics'", |
433 | | -// handler.getLogRecords().stream().filter(logRecord -> logRecord.getMessage().startsWith("Shenandoah heuristics")).count(), |
434 | | -// is(1L)); |
435 | | -// } |
436 | | - |
437 | 317 | @Test |
438 | 318 | public void shenandoah_8u332() throws Exception { |
439 | 319 | TestLogHandler handler = new TestLogHandler(); |
|
0 commit comments