程序包 com.mysql.cj.log
类 ProfilerEventImpl
- java.lang.Object
-
- com.mysql.cj.log.ProfilerEventImpl
-
- 所有已实现的接口:
ProfilerEvent
public class ProfilerEventImpl extends Object implements ProfilerEvent
-
-
字段概要
-
从接口继承的字段 com.mysql.cj.log.ProfilerEvent
NA, TYPE_EXECUTE, TYPE_FETCH, TYPE_OBJECT_CREATION, TYPE_PREPARE, TYPE_QUERY, TYPE_SLOW_QUERY, TYPE_USAGE
-
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 longgetConnectionId()Returns the id of the associated connection (-1 for none).StringgetDatabase()Returns the database the event occurred on.StringgetDurationUnits()Returns the units for getEventDuration()StringgetEventCreationPointAsString()Returns the description of where the event was created.longgetEventCreationTime()Returns the time (in System.currentTimeMillis() form) when this event was created.longgetEventDuration()Returns the duration of the event in millisecondsbytegetEventType()Returns the event typeStringgetHostName()Returns the host name the event occurred on.StringgetMessage()Returns the optional message for this eventintgetResultSetId()Returns the id of the associated result set (-1 for none).intgetStatementId()Returns the id of the associated statement (-1 for none).byte[]pack()Creates a binary representation of this event.StringtoString()Returns a representation of this event as a String.static ProfilerEventunpack(byte[] buf)Unpacks a binary representation of this event.
-
-
-
构造器详细资料
-
ProfilerEventImpl
public ProfilerEventImpl(byte eventType, String hostName, String db, long connectionId, int statementId, int resultSetId, long eventDuration, String durationUnits, Throwable eventCreationPoint, String message)Creates a new profiler event- 参数:
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 message
-
-
方法详细资料
-
getEventType
public byte getEventType()
从接口复制的说明:ProfilerEventReturns the event type- 指定者:
getEventType在接口中ProfilerEvent- 返回:
- the event type
-
getHostName
public String getHostName()
从接口复制的说明:ProfilerEventReturns the host name the event occurred on.- 指定者:
getHostName在接口中ProfilerEvent- 返回:
- host name
-
getDatabase
public String getDatabase()
从接口复制的说明:ProfilerEventReturns the database the event occurred on.- 指定者:
getDatabase在接口中ProfilerEvent- 返回:
- the database in use
-
getConnectionId
public long getConnectionId()
从接口复制的说明:ProfilerEventReturns the id of the associated connection (-1 for none).- 指定者:
getConnectionId在接口中ProfilerEvent- 返回:
- the connection in use
-
getStatementId
public int getStatementId()
从接口复制的说明:ProfilerEventReturns the id of the associated statement (-1 for none).- 指定者:
getStatementId在接口中ProfilerEvent- 返回:
- the statement in use
-
getResultSetId
public int getResultSetId()
从接口复制的说明:ProfilerEventReturns the id of the associated result set (-1 for none).- 指定者:
getResultSetId在接口中ProfilerEvent- 返回:
- the result set in use
-
getEventCreationTime
public long getEventCreationTime()
从接口复制的说明:ProfilerEventReturns the time (in System.currentTimeMillis() form) when this event was created.- 指定者:
getEventCreationTime在接口中ProfilerEvent- 返回:
- the time this event was created
-
getEventDuration
public long getEventDuration()
从接口复制的说明:ProfilerEventReturns the duration of the event in milliseconds- 指定者:
getEventDuration在接口中ProfilerEvent- 返回:
- the duration of the event in milliseconds
-
getDurationUnits
public String getDurationUnits()
从接口复制的说明:ProfilerEventReturns the units for getEventDuration()- 指定者:
getDurationUnits在接口中ProfilerEvent- 返回:
- name of duration units
-
getEventCreationPointAsString
public String getEventCreationPointAsString()
从接口复制的说明:ProfilerEventReturns the description of where the event was created.- 指定者:
getEventCreationPointAsString在接口中ProfilerEvent- 返回:
- a description of where this event was created.
-
getMessage
public String getMessage()
从接口复制的说明:ProfilerEventReturns the optional message for this event- 指定者:
getMessage在接口中ProfilerEvent- 返回:
- the message stored in this event
-
toString
public String toString()
Returns a representation of this event as a String.
-
unpack
public static ProfilerEvent unpack(byte[] buf)
Unpacks a binary representation of this event.- 参数:
buf- the binary representation of this event- 返回:
- the unpacked Event
-
pack
public byte[] pack()
从接口复制的说明:ProfilerEventCreates a binary representation of this event.- 指定者:
pack在接口中ProfilerEvent- 返回:
- a binary representation of this event
-
-