org.adoptopenjdk.jitwatch.model.JITEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jitwatch-jarscan-maven-plugin Show documentation
Show all versions of jitwatch-jarscan-maven-plugin Show documentation
A Maven plugin that scans the project artifact and its dependencies for methods that cannot be inlined by the JIT
compiler. It uses the JarScan utility from the JITWatch project to do that.
See https://github.com/AdoptOpenJDK/jitwatch .
/*
* Copyright (c) 2013, 2014 Chris Newland.
* Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD
* Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki
*/
package org.adoptopenjdk.jitwatch.model;
import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.C_COLON;
import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.C_SPACE;
import org.adoptopenjdk.jitwatch.util.StringUtil;
public class JITEvent
{
private long stamp;
private EventType eventType;
private IMetaMember eventMember;
private String stampString;
public JITEvent(long stamp, EventType eventType, IMetaMember eventMember)
{
this.stamp = stamp;
this.eventType = eventType;
this.eventMember = eventMember;
this.stampString = StringUtil.formatTimestamp(stamp, true);
}
public long getStamp()
{
return stamp;
}
public EventType getEventType()
{
return eventType;
}
public IMetaMember getEventMember()
{
return eventMember;
}
@Override
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append(stampString).append(C_SPACE);
sb.append(StringUtil.alignRight(eventType.getText(), 14)).append(C_SPACE).append(C_COLON).append(C_SPACE);
sb.append(eventMember.toString());
return sb.toString();
}
}