use of com.tagtraum.perf.gcviewer.model.GCEvent in project GCViewer by chewiebug.
the class UsedTenuredRenderer method computePolygon.
@Override
public Polygon computePolygon(ModelChart modelChart, GCModel model) {
ScaledPolygon polygon = createMemoryScaledPolygon();
for (Iterator<AbstractGCEvent<?>> i = model.getStopTheWorldEvents(); i.hasNext(); ) {
AbstractGCEvent<?> abstractGCEvent = i.next();
if (abstractGCEvent instanceof GCEvent) {
GCEvent event = (GCEvent) abstractGCEvent;
GCEvent tenuredEvent = event.getTenured();
if (tenuredEvent != null) {
// e.g. "GC remark" of G1 algorithm does not contain memory information
if (tenuredEvent.getTotal() > 0) {
final double timestamp = event.getTimestamp() - model.getFirstPauseTimeStamp();
polygon.addPoint(timestamp, tenuredEvent.getPreUsed());
polygon.addPoint(timestamp + event.getPause(), tenuredEvent.getPostUsed());
}
}
}
}
// dummy point to make the polygon complete
polygon.addPoint(model.getRunningTime(), 0.0d);
return polygon;
}
use of com.tagtraum.perf.gcviewer.model.GCEvent in project GCViewer by chewiebug.
the class UsedYoungRenderer method computePolygon.
@Override
public Polygon computePolygon(ModelChart modelChart, GCModel model) {
ScaledPolygon polygon = createMemoryScaledPolygon();
GCEvent lastTenuredEvent = null;
GCEvent tenuredEvent = null;
for (Iterator<AbstractGCEvent<?>> i = model.getStopTheWorldEvents(); i.hasNext(); ) {
AbstractGCEvent<?> abstractGCEvent = i.next();
if (abstractGCEvent instanceof GCEvent) {
GCEvent event = (GCEvent) abstractGCEvent;
GCEvent youngEvent = event.getYoung();
int lastTenuredTotal = 0;
int tenuredTotal = 0;
if (youngEvent != null) {
// event contains information about generation (only with -XX:+PrintGCDetails)
if (modelChart.isShowTenured()) {
if (tenuredEvent != null && tenuredEvent.getTotal() > 0) {
lastTenuredEvent = tenuredEvent;
}
if (lastTenuredEvent == null)
lastTenuredEvent = event.getTenured();
tenuredEvent = event.getTenured();
lastTenuredTotal = lastTenuredEvent.getTotal();
tenuredTotal = tenuredEvent.getTotal();
}
// e.g. "GC remark" of G1 algorithm does not contain memory information
if (youngEvent.getTotal() > 0) {
final double timestamp = event.getTimestamp() - model.getFirstPauseTimeStamp();
polygon.addPoint(timestamp, lastTenuredTotal + youngEvent.getPreUsed());
polygon.addPoint(timestamp + event.getPause(), tenuredTotal + youngEvent.getPostUsed());
}
}
}
}
// dummy point to make the polygon complete
polygon.addPoint(model.getRunningTime(), 0.0d);
return polygon;
}
use of com.tagtraum.perf.gcviewer.model.GCEvent in project GCViewer by chewiebug.
the class TestDataReaderJRockit1_5_0 method testSimpleOpts.
@Test
public void testSimpleOpts() throws Exception {
DataReader reader = getDataReader1_5(new GcResourceFile("SampleJRockit1_5_12-gcreport-simpleopts-singlecon.txt"));
GCModel model = reader.read();
assertEquals("count", 5, model.size());
GCEvent event = (GCEvent) model.get(0);
assertEquals("timestamp", 6.771, event.getTimestamp(), 0.000001);
assertEquals("name", Type.JROCKIT_GC.getName(), event.getExtendedType().getName());
assertEquals("before", 3145728, event.getPreUsed());
assertEquals("after", 296406, event.getPostUsed());
assertEquals("total", 3145728, event.getTotal());
assertEquals("pause", 0.066, event.getPause(), 0.0000001);
}
use of com.tagtraum.perf.gcviewer.model.GCEvent in project GCViewer by chewiebug.
the class TestDataReaderJRockit1_5_0 method testGcPrioThroughput.
@Test
public void testGcPrioThroughput() throws Exception {
DataReader reader = getDataReader1_5(new GcResourceFile("SampleJRockit1_5_12_gcpriothroughput.txt"));
GCModel model = reader.read();
assertEquals("count", 8, model.size());
GCEvent event = (GCEvent) model.get(0);
assertEquals("timestamp", 4.817, event.getTimestamp(), 0.000001);
assertEquals("name", Type.JROCKIT_GC.getName(), event.getExtendedType().getName());
assertEquals("before", 1641728, event.getPreUsed());
assertEquals("after", 148365, event.getPostUsed());
assertEquals("total", 3145728, event.getTotal());
assertEquals("pause", 0.039959, event.getPause(), 0.0000001);
}
use of com.tagtraum.perf.gcviewer.model.GCEvent in project GCViewer by chewiebug.
the class TestDataReaderJRockit1_6_0 method testGcPrioPauseSingleParConVerbose.
@Test
public void testGcPrioPauseSingleParConVerbose() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleJRockit1_6_verbose_gc_mode_singleparcon.txt");
gcResource.getLogger().addHandler(handler);
DataReader reader = getDataReader(gcResource);
assertTrue("should be DataReaderJRockit1_6_0 (but was " + reader.toString() + ")", reader instanceof DataReaderJRockit1_6_0);
GCModel model = reader.read();
assertEquals("count", 52, model.size());
GCEvent event = (GCEvent) model.get(0);
assertEquals("timestamp", 26.242, event.getTimestamp(), 0.000001);
assertEquals("name", Type.JROCKIT_16_OLD_GC.getName(), event.getExtendedType().getName());
assertEquals("before", 270909, event.getPreUsed());
assertEquals("after", 210916, event.getPostUsed());
assertEquals("total", 524288, event.getTotal());
assertEquals("pause", 0.032087, event.getPause(), 0.0000001);
assertEquals("number of warnings", 5, handler.getCount());
}
Aggregations