public class ProfilerEventImpl extends java.lang.Object implements ProfilerEvent
| Modifier and Type | Field and Description |
|---|---|
private long |
connectionId |
private java.lang.String |
database |
private java.lang.String |
durationUnits |
private java.lang.String |
eventCreationPointDesc |
private long |
eventCreationTime |
private long |
eventDuration |
private byte |
eventType |
private java.lang.String |
hostName |
private java.lang.String |
message |
private int |
resultSetId |
private int |
statementId |
NA, TYPE_EXECUTE, TYPE_FETCH, TYPE_OBJECT_CREATION, TYPE_PREPARE, TYPE_QUERY, TYPE_SLOW_QUERY, TYPE_USAGE| Modifier | Constructor and Description |
|---|---|
private |
ProfilerEventImpl(byte eventType,
java.lang.String hostName,
java.lang.String db,
long connectionId,
int statementId,
int resultSetId,
long eventCreationTime,
long eventDuration,
java.lang.String durationUnits,
java.lang.String eventCreationPointDesc,
java.lang.String message) |
|
ProfilerEventImpl(byte eventType,
java.lang.String hostName,
java.lang.String db,
long connectionId,
int statementId,
int resultSetId,
long eventDuration,
java.lang.String durationUnits,
java.lang.Throwable eventCreationPoint,
java.lang.String message)
Creates a new profiler event
|
| Modifier and Type | Method and Description |
|---|---|
long |
getConnectionId()
Returns the id of the associated connection (-1 for none).
|
java.lang.String |
getDatabase()
Returns the database the event occurred on.
|
java.lang.String |
getDurationUnits()
Returns the units for getEventDuration()
|
java.lang.String |
getEventCreationPointAsString()
Returns the description of where the event was created.
|
long |
getEventCreationTime()
Returns the time (in System.currentTimeMillis() form) when this event was created.
|
long |
getEventDuration()
Returns the duration of the event in milliseconds
|
byte |
getEventType()
Returns the event type
|
java.lang.String |
getHostName()
Returns the host name the event occurred on.
|
java.lang.String |
getMessage()
Returns the optional message for this event
|
int |
getResultSetId()
Returns the id of the associated result set (-1 for none).
|
int |
getStatementId()
Returns the id of the associated statement (-1 for none).
|
byte[] |
pack()
Creates a binary representation of this event.
|
private static byte[] |
readBytes(byte[] buf,
int pos) |
private static int |
readInt(byte[] buf,
int pos) |
private static long |
readLong(byte[] buf,
int pos) |
java.lang.String |
toString()
Returns a representation of this event as a String.
|
static ProfilerEvent |
unpack(byte[] buf)
Unpacks a binary representation of this event.
|
private static int |
writeBytes(byte[] msg,
byte[] buf,
int pos) |
private static int |
writeInt(int i,
byte[] buf,
int pos) |
private static int |
writeLong(long l,
byte[] buf,
int pos) |
private byte eventType
private java.lang.String hostName
private java.lang.String database
private long connectionId
private int statementId
private int resultSetId
private long eventCreationTime
private long eventDuration
private java.lang.String durationUnits
private java.lang.String eventCreationPointDesc
private java.lang.String message
public ProfilerEventImpl(byte eventType,
java.lang.String hostName,
java.lang.String db,
long connectionId,
int statementId,
int resultSetId,
long eventDuration,
java.lang.String durationUnits,
java.lang.Throwable eventCreationPoint,
java.lang.String message)
eventType - the event type (from the constants TYPE_????)hostName - the hostname where the event occursdb - the database in useconnectionId - the connection id (-1 if N/A)statementId - the statement id (-1 if N/A)resultSetId - the result set id (-1 if N/A)eventDuration - how long did the event last?durationUnits - time units user for eventDurationeventCreationPoint - event creation point as a Throwablemessage - optional messageprivate ProfilerEventImpl(byte eventType,
java.lang.String hostName,
java.lang.String db,
long connectionId,
int statementId,
int resultSetId,
long eventCreationTime,
long eventDuration,
java.lang.String durationUnits,
java.lang.String eventCreationPointDesc,
java.lang.String message)
public byte getEventType()
ProfilerEventgetEventType in interface ProfilerEventpublic java.lang.String getHostName()
ProfilerEventgetHostName in interface ProfilerEventpublic java.lang.String getDatabase()
ProfilerEventgetDatabase in interface ProfilerEventpublic long getConnectionId()
ProfilerEventgetConnectionId in interface ProfilerEventpublic int getStatementId()
ProfilerEventgetStatementId in interface ProfilerEventpublic int getResultSetId()
ProfilerEventgetResultSetId in interface ProfilerEventpublic long getEventCreationTime()
ProfilerEventgetEventCreationTime in interface ProfilerEventpublic long getEventDuration()
ProfilerEventgetEventDuration in interface ProfilerEventpublic java.lang.String getDurationUnits()
ProfilerEventgetDurationUnits in interface ProfilerEventpublic java.lang.String getEventCreationPointAsString()
ProfilerEventgetEventCreationPointAsString in interface ProfilerEventpublic java.lang.String getMessage()
ProfilerEventgetMessage in interface ProfilerEventpublic java.lang.String toString()
toString in class java.lang.Objectpublic static ProfilerEvent unpack(byte[] buf)
buf - the binary representation of this eventpublic byte[] pack()
ProfilerEventpack in interface ProfilerEventprivate static int writeInt(int i,
byte[] buf,
int pos)
private static int writeLong(long l,
byte[] buf,
int pos)
private static int writeBytes(byte[] msg,
byte[] buf,
int pos)
private static int readInt(byte[] buf,
int pos)
private static long readLong(byte[] buf,
int pos)
private static byte[] readBytes(byte[] buf,
int pos)