use of com.tagtraum.perf.gcviewer.model.GCModel in project GCViewer by chewiebug.
the class TestDataReaderSun1_6_0G1 method testDetailedCollectionMixed1.
@Test
public void testDetailedCollectionMixed1() throws Exception {
// parse one detailed event with a mixed line (concurrent event starts in the middle of an stw collection)
// 8.775: [GC pause (young)8.775: [GC concurrent-mark-end, 0.0101638 sec]
// , 0.00831998 secs]
String fileName = "SampleSun1_6_0G1_Detailed-mixedLine1.txt";
InputStream in = getInputStream(fileName);
DataReader reader = new DataReaderSun1_6_0G1(new GcResourceFile(fileName), in, GcLogType.SUN1_6G1);
GCModel model = reader.read();
assertEquals("nummber of events", 2, model.size());
assertEquals("number of pauses", 1, model.getPause().getN());
assertEquals("gc pause sum", 0.00831998, model.getPause().getSum(), 0.000000001);
assertEquals("gc memory", 169 * 1024 - 162 * 1024, model.getFreedMemoryByGC().getMax());
}
use of com.tagtraum.perf.gcviewer.model.GCModel in project GCViewer by chewiebug.
the class TestDataReaderSun1_6_0G1 method testGcPattern.
@Test
public void testGcPattern() throws Exception {
InputStream in = new ByteArrayInputStream(("0.452: [GC concurrent-count-start]").getBytes());
DataReader reader = new DataReaderSun1_6_0G1(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6G1);
GCModel model = reader.read();
assertEquals("count", 1, model.size());
assertEquals("full gc pause", 0, model.getFullGCPause().getN());
assertEquals("gc pause", 0, model.getGCPause().getN());
}
use of com.tagtraum.perf.gcviewer.model.GCModel in project GCViewer by chewiebug.
the class TestDataReaderSun1_6_0G1 method testDetailedCollectionMixed3.
@Test
public void testDetailedCollectionMixed3() throws Exception {
// parse one detailed event with a mixed line (part of concurrent event starts in the middle of an stw collection)
// 0.331: [GC pause (young)0.333 (initial-mark), 0.00178520 secs]
// : [GC concurrent-mark-start]
String fileName = "SampleSun1_6_0G1_Detailed-mixedLine3.txt";
InputStream in = getInputStream(fileName);
DataReader reader = new DataReaderSun1_6_0G1(new GcResourceFile(fileName), in, GcLogType.SUN1_6G1);
GCModel model = reader.read();
assertEquals("nummber of events", 2, model.size());
assertEquals("concurrent event type", Type.G1_CONCURRENT_MARK_START.toString(), model.getConcurrentGCEvents().next().getTypeAsString());
assertEquals("number of pauses", 1, model.getPause().getN());
assertEquals("gc pause sum", 0.00178520, model.getPause().getSum(), 0.000000001);
}
use of com.tagtraum.perf.gcviewer.model.GCModel 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.GCModel in project GCViewer by chewiebug.
the class TestDataReaderSun1_6_0G1 method testG1FullGcSystemGc.
@Test
public void testG1FullGcSystemGc() throws Exception {
InputStream in = new ByteArrayInputStream(("9.978: [Full GC (System.gc()) 597M->1142K(7168K), 0.1604955 secs]").getBytes());
DataReader reader = new DataReaderSun1_6_0G1(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6G1);
GCModel model = reader.read();
assertEquals("count", 1, model.size());
assertEquals("full gc pause", 0.1604955, model.getFullGCPause().getMax(), 0.000001);
}
Aggregations