use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderSun1_8_0G1 method printHeapAtGC.
@Test
public void printHeapAtGC() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleSun1_8_0G1PrintHeapAtGc.txt");
gcResource.getLogger().addHandler(handler);
DataReader reader = getDataReader(gcResource);
GCModel model = reader.read();
assertEquals("gc pause sum", 0.0055924, model.getPause().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_8_0G1 method fullConcurrentCycle.
@Test
public void fullConcurrentCycle() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleSun1_8_0G1_ConcurrentCycle.txt");
gcResource.getLogger().addHandler(handler);
DataReader reader = getDataReader(gcResource);
GCModel model = reader.read();
assertThat("size", model.size(), is(10));
assertThat("tenured size after concurrent cycle", model.getPostConcurrentCycleTenuredUsedSizes().getMax(), is(31949 - 10 * 1024 - 3072));
assertThat("heap size after concurrent cycle", model.getPostConcurrentCycleHeapUsedSizes().getMax(), is(31949));
assertThat("initiatingOccupancyFraction", model.getCmsInitiatingOccupancyFraction().getMax(), closeTo(0.69, 0.001));
assertThat("number of errors", handler.getCount(), is(0));
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderSun1_8_0G1 method extendedRemark.
@Test
public void extendedRemark() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleSun1_8_0G1extended-remark.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(0));
assertThat("pause duration", model.get(0).getPause(), closeTo(0.1005220, 0.00000001));
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestGCResourceGroup method testGetGCResourceList_SingleSeries.
@Test
public void testGetGCResourceList_SingleSeries() throws Exception {
File file1 = temporaryFolder.newFile();
File file2 = temporaryFolder.newFile();
File file3 = temporaryFolder.newFile();
List<GCResource> resources = Arrays.asList(new GcResourceFile(file1), new GcResourceFile(file2), new GcResourceFile(file3));
GCResourceGroup group = new GCResourceGroup(file1.toURI().toURL().toString() + ">" + file2.toURI().toURL().toString() + ">" + file3.toURI().toURL().toString());
assertThat(group.getGCResourceList(), contains(new GcResourceSeries(resources)));
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestGCResourceGroup method testGetGCResourceList_SeveralSeries.
@Test
public void testGetGCResourceList_SeveralSeries() throws Exception {
File file1 = temporaryFolder.newFile();
File file2 = temporaryFolder.newFile();
File file3 = temporaryFolder.newFile();
List<GCResource> resourcesForSeries1 = Arrays.asList(new GcResourceFile(file1), new GcResourceFile(file2), new GcResourceFile(file3));
File file4 = temporaryFolder.newFile();
File file5 = temporaryFolder.newFile();
File file6 = temporaryFolder.newFile();
String resourceNameGroup1 = file1.toURI().toURL().toString() + ">" + file2.toURI().toURL().toString() + ">" + file3.toURI().toURL().toString();
String resourceNameGroup2 = file4.toURI().toURL().toString() + ">" + file5.toURI().toURL().toString() + ">" + file6.toURI().toURL().toString();
GCResourceGroup group = new GCResourceGroup(resourceNameGroup1 + ";" + resourceNameGroup2);
List<GCResource> resourcesForSeries2 = Arrays.asList(new GcResourceFile(file4), new GcResourceFile(file5), new GcResourceFile(file6));
assertThat(group.getGCResourceList(), contains(new GcResourceSeries(resourcesForSeries1), new GcResourceSeries(resourcesForSeries2)));
}
Aggregations