use of com.tagtraum.perf.gcviewer.model.GcResourceFile in project GCViewer by chewiebug.
the class TestDataReaderSun1_6_0 method testDerivedGenerationValues.
/**
* Often only the young generation information is explicitly present. Old generation memory
* size can be derived from heap - young size. This test checks for presence of derived memory
* information.
*/
@Test
public void testDerivedGenerationValues() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream("10.675: [GC [PSYoungGen: 21051K->4947K(22656K)] 23342K->7238K(67712K), 0.0191817 secs] [Times: user=0.09 sys=0.01, real=0.02 secs]".getBytes());
DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("young used", 21051, model.getYoungUsedSizes().getMin());
assertEquals("young allocated", 22656, model.getYoungAllocatedSizes().getMax());
assertEquals("tenured used", 23342 - 21051, model.getTenuredUsedSizes().getMin());
assertEquals("tenured allocated", 67712 - 22656, model.getTenuredAllocatedSizes().getMax());
}
use of com.tagtraum.perf.gcviewer.model.GcResourceFile in project GCViewer by chewiebug.
the class TestDataReaderSun1_6_0 method testPrintHeapAtGC.
@Test
public void testPrintHeapAtGC() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleSun1_6_0PrintHeapAtGC.txt");
gcResource.getLogger().addHandler(handler);
InputStream in = getInputStream(gcResource.getResourceName());
DataReader reader = new DataReaderSun1_6_0(gcResource, in, GcLogType.SUN1_6);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("GC pause", 0.0134287, model.getGCPause().getMin(), 0.000000001);
assertEquals("number of errors", 0, handler.getCount());
}
use of com.tagtraum.perf.gcviewer.model.GcResourceFile in project GCViewer by chewiebug.
the class TestDataReaderSun1_6_0 method logfileRollingProducesNoWarnings.
@Test
public void logfileRollingProducesNoWarnings() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleSun1_8_0RollingLogfile.txt");
gcResource.getLogger().addHandler(handler);
InputStream in = getInputStream(gcResource.getResourceName());
DataReader reader = new DataReaderSun1_6_0(gcResource, in, GcLogType.SUN1_6);
reader.read();
assertThat("number of errors", handler.getCount(), is(0));
}
use of com.tagtraum.perf.gcviewer.model.GcResourceFile in project GCViewer by chewiebug.
the class TestDataReaderSun1_6_0 method testPrintCmsStatisticsConcurrentMark.
@Test
public void testPrintCmsStatisticsConcurrentMark() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(("2012-10-20T18:04:57.850+0200: 1.327: [CMS-concurrent-mark: 0.011/0.011 secs] (CMS-concurrent-mark yielded 0 times)" + "\n [Times: user=0.03 sys=0.00, real=0.01 secs]").getBytes());
DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
GCModel model = reader.read();
assertEquals("GC count", 1, model.size());
assertEquals("GC pause", 0.011, model.getConcurrentEventPauses().values().iterator().next().getMin(), 0.000000001);
}
use of com.tagtraum.perf.gcviewer.model.GcResourceFile in project GCViewer by chewiebug.
the class TestDataReaderSun1_6_0 method testLineMixesPrintTenuringDistribution.
@Test
public void testLineMixesPrintTenuringDistribution() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(("2011-03-31T06:01:25.675+0200: 5682.440: [GC 5682.441: [ParNew2011-03-31T06:01:25.682+0200: 5682.447: [CMS-concurrent-abortable-preclean: 0.035/0.348 secs]" + "\nDesired survivor size 557056 bytes, new threshold 4 (max 4)" + "\n- age 1: 1104 bytes, 1104 total" + "\n- age 2: 52008 bytes, 53112 total" + "\n- age 3: 4400 bytes, 57512 total" + "\n [Times: user=0.59 sys=0.01, real=0.35 secs]" + "\n: 9405K->84K(10368K), 0.0064674 secs] 151062K->141740K(164296K), 0.0067202 secs] [Times: user=0.11 sys=0.01, real=0.01 secs]").getBytes());
DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
GCModel model = reader.read();
assertEquals("GC count", 2, model.size());
assertEquals("event pause", 0.0067202, model.getGCPause().getMax(), 0.0000001);
}
Aggregations