use of com.tagtraum.perf.gcviewer.model.GCEvent in project GCViewer by chewiebug.
the class DataReaderSun1_3_1 method parseLine.
protected AbstractGCEvent<GCEvent> parseLine(String line, ParseInformation pos) throws ParseException {
AbstractGCEvent<GCEvent> event = new GCEvent();
try {
event.setTimestamp(count);
count++;
StringTokenizer st = new StringTokenizer(line, " ,->()K\r\n");
String token = st.nextToken();
if (token.equals("Full") && st.nextToken().equals("GC")) {
event.setType(AbstractGCEvent.Type.FULL_GC);
} else if (token.equals("Inc") && st.nextToken().equals("GC")) {
event.setType(AbstractGCEvent.Type.INC_GC);
} else if (token.equals("GC")) {
event.setType(AbstractGCEvent.Type.GC);
} else {
throw new ParseException("Error parsing entry: " + line);
}
setMemoryAndPauses((GCEvent) event, line);
//System.out.println("Real : [" + line + "]");
return event;
} catch (RuntimeException rte) {
final ParseException parseException = new ParseException("Error parsing entry: " + line + ", " + rte.toString());
parseException.initCause(rte);
throw parseException;
}
}
use of com.tagtraum.perf.gcviewer.model.GCEvent in project GCViewer by chewiebug.
the class IncLineRenderer method paintComponent.
public void paintComponent(Graphics2D g2d) {
double scaleFactor = getModelChart().getScaleFactor();
int height = getHeight();
int lastScaledTimestamp = Integer.MIN_VALUE;
for (Iterator<GCEvent> i = getModelChart().getModel().getGCEvents(); i.hasNext(); ) {
GCEvent event = i.next();
if (event.isInc()) {
int scaledTimestamp = (int) (scaleFactor * (event.getTimestamp() - getModelChart().getModel().getFirstPauseTimeStamp()));
if (scaledTimestamp != lastScaledTimestamp) {
g2d.drawLine(scaledTimestamp, 0, scaledTimestamp, height);
lastScaledTimestamp = scaledTimestamp;
}
}
}
}
use of com.tagtraum.perf.gcviewer.model.GCEvent in project GCViewer by chewiebug.
the class TotalTenuredRenderer method computePolygon.
public Polygon computePolygon(ModelChart modelChart, GCModel model) {
ScaledPolygon polygon = createMemoryScaledPolygon();
polygon.addPoint(0.0d, 0.0d);
double lastTotal = 0;
for (Iterator<AbstractGCEvent<?>> i = model.getStopTheWorldEvents(); i.hasNext(); ) {
AbstractGCEvent<?> abstractGCEvent = i.next();
if (abstractGCEvent instanceof GCEvent) {
GCEvent event = (GCEvent) abstractGCEvent;
GCEvent tenured = event.getTenured();
if (hasMemoryInformation(event) && tenured != null) {
if (polygon.npoints == 1) {
// first point needs to be treated different from the rest,
// because otherwise the polygon would not start with a vertical line at 0,
// but with a slanting line between 0 and after the first pause
polygon.addPoint(0, (double) tenured.getTotal());
}
polygon.addPoint(tenured.getTimestamp() - model.getFirstPauseTimeStamp() + event.getPause(), tenured.getTotal());
lastTotal = tenured.getTotal();
}
}
}
polygon.addPointNotOptimised(model.getRunningTime(), lastTotal);
polygon.addPointNotOptimised(model.getRunningTime(), 0.0d);
return polygon;
}
use of com.tagtraum.perf.gcviewer.model.GCEvent in project GCViewer by chewiebug.
the class UsedHeapRenderer method computePolygon.
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;
// e.g. "GC remark" of G1 algorithm does not contain memory information
if (event.getTotal() > 0) {
final double timestamp = event.getTimestamp() - model.getFirstPauseTimeStamp();
polygon.addPoint(timestamp, event.getPreUsed());
polygon.addPoint(timestamp + event.getPause(), event.getPostUsed());
}
}
}
// dummy point to make the polygon complete
polygon.addPoint(model.getRunningTime(), 0.0d);
//System.out.println("last x coord " + polygon.xpoints[polygon.npoints-1]);
return polygon;
}
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;
}
Aggregations