use of com.tagtraum.perf.gcviewer.model.GCEvent in project GCViewer by chewiebug.
the class TestDataReaderJRockit1_4_2 method testParseGenCon.
@Test
public void testParseGenCon() throws Exception {
// TODO refactor JRockit DataReader
DataReader reader = getDataReader1_5("SampleJRockit1_4_2gencon.txt");
GCModel model = reader.read();
assertEquals("count", 123, model.size());
GCEvent event = (GCEvent) model.get(0);
assertEquals("timestamp", 77.737, event.getTimestamp(), 0.000001);
assertEquals("name", Type.JROCKIT_NURSERY_GC.getName(), event.getExtendedType().getName());
assertEquals("before", 630435, event.getPreUsed());
assertEquals("after", 183741, event.getPostUsed());
assertEquals("total", 1048576, event.getTotal());
assertEquals("pause", 0.566158, event.getPause(), 0.0000001);
}
use of com.tagtraum.perf.gcviewer.model.GCEvent in project GCViewer by chewiebug.
the class TestDataReaderJRockit1_5_0 method testGenCon.
@Test
public void testGenCon() throws Exception {
DataReader reader = getDataReader1_5(new GcResourceFile("SampleJRockit1_5_12_gencon.txt"));
GCModel model = reader.read();
assertEquals("count", 8, model.size());
GCEvent event = (GCEvent) model.get(0);
assertEquals("timestamp", 6.038, event.getTimestamp(), 0.000001);
assertEquals("name", Type.JROCKIT_GC.getName(), event.getExtendedType().getName());
assertEquals("before", 3089328, event.getPreUsed());
assertEquals("after", 352551, event.getPostUsed());
assertEquals("total", 3145728, event.getTotal());
assertEquals("pause", 0.1186, event.getPause(), 0.0000001);
}
use of com.tagtraum.perf.gcviewer.model.GCEvent in project GCViewer by chewiebug.
the class TestDataReaderIBM_J9_R27 method testFullHeaderWithAfGcs.
@Test
public void testFullHeaderWithAfGcs() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleIBMJ9_R27_SR1_full_header.txt");
gcResource.getLogger().addHandler(handler);
DataReader reader = getDataReader(gcResource);
GCModel model = reader.read();
assertThat("model size", model.size(), is(3));
GCEvent event = (GCEvent) model.get(0);
assertThat("pause", event.getPause(), closeTo(0.042303, 0.0000001));
assertThat("total before", event.getTotal(), is(toKiloBytes(1073741824)));
assertThat("free before", event.getPreUsed(), is(toKiloBytes(1073741824 - 804158480)));
assertThat("free after", event.getPostUsed(), is(toKiloBytes(1073741824 - 912835672)));
assertThat("total young before", event.getYoung().getTotal(), is(toKiloBytes(268435456)));
assertThat("young before", event.getYoung().getPreUsed(), is(toKiloBytes(268435456)));
assertThat("young after", event.getYoung().getPostUsed(), is(toKiloBytes(268435456 - 108677192)));
assertThat("total tenured before", event.getTenured().getTotal(), is(toKiloBytes(805306368)));
assertThat("tenured before", event.getTenured().getPreUsed(), is(toKiloBytes(805306368 - 804158480)));
assertThat("tenured after", event.getTenured().getPostUsed(), is(toKiloBytes(805306368 - 804158480)));
assertThat("timestamp 1", event.getTimestamp(), closeTo(0.0, 0.0001));
assertThat("timestamp 2", model.get(1).getTimestamp(), closeTo(1.927, 0.0001));
assertThat("timestamp 3", model.get(2).getTimestamp(), closeTo(3.982, 0.0001));
assertThat("number of errors", handler.getCount(), is(1));
}
use of com.tagtraum.perf.gcviewer.model.GCEvent in project GCViewer by chewiebug.
the class ModelMetricsPanelTest method testOneElementModel.
@Test
public void testOneElementModel() {
GCEvent event = new GCEvent();
event.setTimestamp(0.5);
event.setType(Type.G1_YOUNG_INITIAL_MARK);
event.setPause(0.245);
event.setPreUsed(900);
event.setPostUsed(400);
event.setTotal(1024);
GCModel model = new GCModel();
model.add(event);
ModelMetricsPanel panel = new ModelMetricsPanel();
// first add empty model; is done when opened
panel.setModel(new GCModel());
// only later a model with entries is set
panel.setModel(model);
}
use of com.tagtraum.perf.gcviewer.model.GCEvent in project GCViewer by chewiebug.
the class ModelMetricsPanelTest method testTwoElementsModel.
@Test
public void testTwoElementsModel() {
GCModel model = new GCModel();
GCEvent event = new GCEvent();
event.setTimestamp(0.5);
event.setType(Type.G1_YOUNG_INITIAL_MARK);
event.setPause(0.245);
event.setPreUsed(900);
event.setPostUsed(400);
event.setTotal(1024);
model.add(event);
event = new GCEvent();
event.setTimestamp(0.75);
event.setType(Type.G1_YOUNG_INITIAL_MARK);
event.setPause(0.245);
event.setPreUsed(800);
event.setPostUsed(300);
event.setTotal(1024);
model.add(event);
ModelMetricsPanel panel = new ModelMetricsPanel();
panel.setModel(model);
}
Aggregations