use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderSun1_8_0G1 method humongousMixed.
@Test
public void humongousMixed() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleSun1_8_0G1HumongousMixed.txt");
gcResource.getLogger().addHandler(handler);
DataReader reader = getDataReader(gcResource);
GCModel model = reader.read();
assertThat("number of events", model.size(), is(1));
assertThat("number of errors", handler.getCount(), is(2));
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderSun1_6_0G1 method testPrintHeapAtGC.
@Test
public void testPrintHeapAtGC() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleSun1_6_0G1_PrintHeapAtGC.txt");
gcResource.getLogger().addHandler(handler);
InputStream in = getInputStream(gcResource.getResourceName());
DataReader reader = new DataReaderSun1_6_0G1(gcResource, in, GcLogType.SUN1_6G1);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("GC pause", 0.00582962 + 0.00228253, model.getGCPause().getSum(), 0.000000001);
assertEquals("number of errors", 0, handler.getCount());
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderSun1_6_0G1 method initialMarkHeapAtGcMixed.
@Test
public void initialMarkHeapAtGcMixed() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleSun1_6_0G1InitialMarkMixed.txt");
gcResource.getLogger().addHandler(handler);
InputStream in = getInputStream(gcResource.getResourceName());
DataReader reader = new DataReaderSun1_6_0G1(gcResource, in, GcLogType.SUN1_6G1);
GCModel model = reader.read();
assertThat("GC count", model.size(), is(2));
assertThat("GC pause", model.getGCPause().getSum(), closeTo(0.03643900, 0.000000001));
assertThat("heap size", model.getHeapAllocatedSizes().getMax(), is(10240 * 1024));
assertThat("number of errors", handler.getCount(), is(0));
assertThat("concurrent type name", model.getConcurrentGCEvents().next().getTypeAsString(), equalTo("GC concurrent-mark-start"));
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderSun1_6_0G1 method testMarkStackFull.
@Test
public void testMarkStackFull() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleSun1_6_0G1_MarkStackFull.txt");
gcResource.getLogger().addHandler(handler);
InputStream in = getInputStream(gcResource.getResourceName());
DataReader reader = new DataReaderSun1_6_0G1(gcResource, in, GcLogType.SUN1_6G1);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("GC pause", 0.08032150, model.getGCPause().getSum(), 0.000000001);
assertEquals("heap size", 3985 * 1024, model.getHeapAllocatedSizes().getMax());
assertEquals("number of errors", 0, handler.getCount());
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderSun1_6_0G1 method testG1GcVerbose.
/**
* Test G1 parser with a gc verbose file (not -XX:+PrintGCDetails)
*/
@Test
public void testG1GcVerbose() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleSun1_6_0G1_gc_verbose.txt");
gcResource.getLogger().addHandler(handler);
InputStream in = getInputStream(gcResource.getResourceName());
DataReader reader = new DataReaderSun1_6_0G1(gcResource, in, GcLogType.SUN1_6G1);
GCModel model = reader.read();
assertEquals("gc pause sum", 62.616796, model.getPause().getSum(), 0.000000001);
assertEquals("throughput", 47.7730602904, model.getThroughput(), 0.000000001);
assertEquals("longest pause", 0.1581177, model.getPause().getMax(), 0.000001);
assertEquals("total runtime", 119.8936724, model.getRunningTime(), 0.000001);
assertEquals("number of errors", 0, handler.getCount());
assertEquals("max interval", 0.211, model.getPauseInterval().getMax(), 0.000001);
assertEquals("avg interval", 0.048291297, model.getPauseInterval().average(), 0.0000001);
assertThat("count footprint after full gc", model.getFootprintAfterFullGC().getN(), is(5));
assertThat("max footprint after full gc", model.getFootprintAfterFullGC().getMax(), is(33 * 1024));
assertThat("tenured: count after concurrent sizes", model.getPostConcurrentCycleTenuredUsedSizes().getN(), is(242));
assertThat("tenured: max size after concurrent", model.getPostConcurrentCycleTenuredUsedSizes().getMax(), is(152576));
assertThat("count after concurrent sizes", model.getPostConcurrentCycleHeapUsedSizes().getN(), is(242));
assertThat("max size after concurrent", model.getPostConcurrentCycleHeapUsedSizes().getMax(), is(152576));
}
Aggregations