public class ProfilerEventImpl extends java.lang.Object implements ProfilerEvent
NA, TYPE_EXECUTE, TYPE_FETCH, TYPE_OBJECT_CREATION, TYPE_PREPARE, TYPE_QUERY, TYPE_SLOW_QUERY, TYPE_USAGE| Constructor and Description |
|---|
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.
|
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.
|
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 messagepublic 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 ProfilerEvent