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));
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestGCResourceGroup method setup.
@Before
public void setup() {
GCResource gcResource1 = new GcResourceFile("gcResource1");
gcResource1.getModel().add(new GCEvent(1.1, 100, 50, 200, 0.003, Type.GC));
GCResource gcResource2 = new GcResourceFile("gcResource2");
gcResource2.getModel().add(new GCEvent(1.5, 1000, 400, 2000, 0.044, Type.FULL_GC));
gcResourceList = new ArrayList<>();
gcResourceList.add(gcResource1);
gcResourceList.add(gcResource2);
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderSun1_8_0 method scavengeBeforeRemark_HeapAtGC_PrintTenuringDistribution_PrintFLSStats.
@Test
public void scavengeBeforeRemark_HeapAtGC_PrintTenuringDistribution_PrintFLSStats() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleSun1_8_0CMS_ScavengeBR_HeapAtGC_TenuringDist_PrintFLS.txt");
gcResource.getLogger().addHandler(handler);
DataReader reader = getDataReader(gcResource);
GCModel model = reader.read();
assertThat("gc count", model.size(), is(2));
assertThat("scavenge before remark event", model.get(0).getPause(), closeTo(0.1306264, 0.000000001));
assertThat("remark event", model.get(1).getPause(), closeTo(0.1787717 - 0.1306264, 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_8_0 method cmsPrintHeapBeforeFullGc.
@Test
public void cmsPrintHeapBeforeFullGc() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleSun1_8_0CMS_HeadDumpBeforeFullGc.txt");
gcResource.getLogger().addHandler(handler);
DataReader reader = getDataReader(gcResource);
GCModel model = reader.read();
assertThat("gc count", model.size(), is(2));
assertThat("gc name concurrent", model.get(0).getTypeAsString(), equalTo("CMS-concurrent-mark"));
assertThat("gc name full gc", model.get(1).getTypeAsString(), equalTo("Full GC (GCLocker Initiated GC); CMS (concurrent mode failure); Metaspace"));
assertThat("pause", model.get(1).getPause(), closeTo(218.6928810, 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_8_0 method parallelPrintTenuringGcCause.
@Test
public void parallelPrintTenuringGcCause() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleSun1_8_0Parallel_Tenuring_PrintGCCause.txt");
gcResource.getLogger().addHandler(handler);
DataReader reader = getDataReader(gcResource);
GCModel model = reader.read();
assertThat("gc count", model.size(), is(5));
assertThat("gc name", model.get(0).getTypeAsString(), equalTo("GC (Allocation Failure); PSYoungGen"));
assertThat("pause", model.get(0).getPause(), closeTo(0.0199218, 0.000000001));
assertEquals("number of errors", 0, handler.getCount());
}
Aggregations