Top Fields Constructors Methods
com.mysql.cj.log

public Class ProfilerEventImpl

extends Object
implements ProfilerEvent
Class Inheritance
All Implemented Interfaces
com.mysql.cj.log.ProfilerEvent
Imports
java.util.Date, com.mysql.cj.util.LogUtils, .StringUtils

Field Summary

Modifier and TypeField and Description
private long
private String
private String
private String
private long
private long
private byte
private String
private String
private int
private int

Constructor Summary

AccessConstructor and Description
public
ProfilerEventImpl(byte
the event type (from the constants TYPE_????)
eventType
,
String
the hostname where the event occurs
hostName
,
String
the database in use
db
,
long
the connection id (-1 if N/A)
connectionId
,
int
the statement id (-1 if N/A)
statementId
,
int
the result set id (-1 if N/A)
resultSetId
,
long
how long did the event last?
eventDuration
,
String
time units user for eventDuration
durationUnits
,
Throwable
event creation point as a Throwable
eventCreationPoint
,
String
optional message
message
)

Creates a new profiler event

private
ProfilerEventImpl(byte eventType, String hostName, String db, long connectionId, int statementId, int resultSetId, long eventCreationTime, long eventDuration, String durationUnits, String eventCreationPointDesc, String message)

Method Summary

Modifier and TypeMethod and Description
public long
getConnectionId()

Implements com.mysql.cj.log.ProfilerEvent.getConnectionId.

Returns the id of the associated connection (-1 for none).

public String
getDatabase()

Implements com.mysql.cj.log.ProfilerEvent.getDatabase.

Returns the database the event occurred on.

public String
getDurationUnits()

Implements com.mysql.cj.log.ProfilerEvent.getDurationUnits.

Returns the units for getEventDuration()

public String
getEventCreationPointAsString()

Implements com.mysql.cj.log.ProfilerEvent.getEventCreationPointAsString.

Returns the description of where the event was created.

public long
getEventCreationTime()

Implements com.mysql.cj.log.ProfilerEvent.getEventCreationTime.

Returns the time (in System.currentTimeMillis() form) when this event was created.

public long
getEventDuration()

Implements com.mysql.cj.log.ProfilerEvent.getEventDuration.

Returns the duration of the event in milliseconds

public byte
getEventType()

Implements com.mysql.cj.log.ProfilerEvent.getEventType.

Returns the event type

public String
getHostName()

Implements com.mysql.cj.log.ProfilerEvent.getHostName.

Returns the host name the event occurred on.

public String
getMessage()

Implements com.mysql.cj.log.ProfilerEvent.getMessage.

Returns the optional message for this event

public int
getResultSetId()

Implements com.mysql.cj.log.ProfilerEvent.getResultSetId.

Returns the id of the associated result set (-1 for none).

public int
getStatementId()

Implements com.mysql.cj.log.ProfilerEvent.getStatementId.

Returns the id of the associated statement (-1 for none).

public byte[]
pack()

Implements com.mysql.cj.log.ProfilerEvent.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)

public String

Returns:

a String representation of this event.
toString
()

Overrides java.lang.Object.toString.

Returns a representation of this event as a String.

public static ProfilerEvent

Returns:

the unpacked Event
unpack
(byte[]
the binary representation of this event
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)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

connectionIdback to summary
private long connectionId
databaseback to summary
private String database
durationUnitsback to summary
private String durationUnits
eventCreationPointDescback to summary
private String eventCreationPointDesc
eventCreationTimeback to summary
private long eventCreationTime
eventDurationback to summary
private long eventDuration
eventTypeback to summary
private byte eventType
hostNameback to summary
private String hostName
messageback to summary
private String message
resultSetIdback to summary
private int resultSetId
statementIdback to summary
private int statementId

Constructor Detail

ProfilerEventImplback to summary
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

Parameters
eventType:byte

the event type (from the constants TYPE_????)

hostName:String

the hostname where the event occurs

db:String

the database in use

connectionId:long

the connection id (-1 if N/A)

statementId:int

the statement id (-1 if N/A)

resultSetId:int

the result set id (-1 if N/A)

eventDuration:long

how long did the event last?

durationUnits:String

time units user for eventDuration

eventCreationPoint:Throwable

event creation point as a Throwable

message:String

optional message

ProfilerEventImplback to summary
private ProfilerEventImpl(byte eventType, String hostName, String db, long connectionId, int statementId, int resultSetId, long eventCreationTime, long eventDuration, String durationUnits, String eventCreationPointDesc, String message)

Method Detail

getConnectionIdback to summary
public long getConnectionId()

Implements com.mysql.cj.log.ProfilerEvent.getConnectionId.

Doc from com.mysql.cj.log.ProfilerEvent.getConnectionId.

Returns the id of the associated connection (-1 for none).

Returns:long

the connection in use

Annotations
@Override
getDatabaseback to summary
public String getDatabase()

Implements com.mysql.cj.log.ProfilerEvent.getDatabase.

Doc from com.mysql.cj.log.ProfilerEvent.getDatabase.

Returns the database the event occurred on.

Returns:String

the database in use

Annotations
@Override
getDurationUnitsback to summary
public String getDurationUnits()

Implements com.mysql.cj.log.ProfilerEvent.getDurationUnits.

Doc from com.mysql.cj.log.ProfilerEvent.getDurationUnits.

Returns the units for getEventDuration()

Returns:String

name of duration units

Annotations
@Override
getEventCreationPointAsStringback to summary
public String getEventCreationPointAsString()

Implements com.mysql.cj.log.ProfilerEvent.getEventCreationPointAsString.

Doc from com.mysql.cj.log.ProfilerEvent.getEventCreationPointAsString.

Returns the description of where the event was created.

Returns:String

a description of where this event was created.

Annotations
@Override
getEventCreationTimeback to summary
public long getEventCreationTime()

Implements com.mysql.cj.log.ProfilerEvent.getEventCreationTime.

Doc from com.mysql.cj.log.ProfilerEvent.getEventCreationTime.

Returns the time (in System.currentTimeMillis() form) when this event was created.

Returns:long

the time this event was created

Annotations
@Override
getEventDurationback to summary
public long getEventDuration()

Implements com.mysql.cj.log.ProfilerEvent.getEventDuration.

Doc from com.mysql.cj.log.ProfilerEvent.getEventDuration.

Returns the duration of the event in milliseconds

Returns:long

the duration of the event in milliseconds

Annotations
@Override
getEventTypeback to summary
public byte getEventType()

Implements com.mysql.cj.log.ProfilerEvent.getEventType.

Doc from com.mysql.cj.log.ProfilerEvent.getEventType.

Returns the event type

Returns:byte

the event type

Annotations
@Override
getHostNameback to summary
public String getHostName()

Implements com.mysql.cj.log.ProfilerEvent.getHostName.

Doc from com.mysql.cj.log.ProfilerEvent.getHostName.

Returns the host name the event occurred on.

Returns:String

host name

Annotations
@Override
getMessageback to summary
public String getMessage()

Implements com.mysql.cj.log.ProfilerEvent.getMessage.

Doc from com.mysql.cj.log.ProfilerEvent.getMessage.

Returns the optional message for this event

Returns:String

the message stored in this event

Annotations
@Override
getResultSetIdback to summary
public int getResultSetId()

Implements com.mysql.cj.log.ProfilerEvent.getResultSetId.

Doc from com.mysql.cj.log.ProfilerEvent.getResultSetId.

Returns the id of the associated result set (-1 for none).

Returns:int

the result set in use

Annotations
@Override
getStatementIdback to summary
public int getStatementId()

Implements com.mysql.cj.log.ProfilerEvent.getStatementId.

Doc from com.mysql.cj.log.ProfilerEvent.getStatementId.

Returns the id of the associated statement (-1 for none).

Returns:int

the statement in use

Annotations
@Override
packback to summary
public byte[] pack()

Implements com.mysql.cj.log.ProfilerEvent.pack.

Doc from com.mysql.cj.log.ProfilerEvent.pack.

Creates a binary representation of this event.

Returns:byte[]

a binary representation of this event

Annotations
@Override
readBytesback to summary
private static byte[] readBytes(byte[] buf, int pos)
readIntback to summary
private static int readInt(byte[] buf, int pos)
readLongback to summary
private static long readLong(byte[] buf, int pos)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a representation of this event as a String.

Returns:String

a String representation of this event.

Annotations
@Override
unpackback to summary
public static ProfilerEvent unpack(byte[] buf)

Unpacks a binary representation of this event.

Parameters
buf:byte[]

the binary representation of this event

Returns:ProfilerEvent

the unpacked Event

writeBytesback to summary
private static int writeBytes(byte[] msg, byte[] buf, int pos)
writeIntback to summary
private static int writeInt(int i, byte[] buf, int pos)
writeLongback to summary
private static int writeLong(long l, byte[] buf, int pos)