com.mysql.cj.log

## Interface ProfilerEvent

    public interface ProfilerEvent

### Field Summary

Fields
`static byte` `NA` Not available value.
`static byte` `TYPE_EXECUTE` Profiler event for prepared statements being executed
`static byte` `TYPE_FETCH` Profiler event for result sets being retrieved
`static byte` `TYPE_OBJECT_CREATION` Profiler creating object type event
`static byte` `TYPE_PREPARE` Profiler event for prepared statements being prepared
`static byte` `TYPE_QUERY` Profiler event for a query being executed
`static byte` `TYPE_SLOW_QUERY` Profiler event for slow query
`static byte` `TYPE_USAGE` Profiler event for usage advisor

### Method Summary

All Methods Instance Methods Abstract Methods
`long` `getConnectionId()` Returns the id of the associated connection (-1 for none).
`String` `getDatabase()` Returns the database the event occurred on.
`String` `getDurationUnits()` Returns the units for getEventDuration()
`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
`String` `getHostName()` Returns the host name the event occurred on.
`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.

### Field Detail

#### TYPE_USAGE

    static final byte TYPE_USAGE

Profiler event for usage advisor

See Also:
  Constant Field Values

#### TYPE_OBJECT_CREATION

    static final byte TYPE_OBJECT_CREATION

Profiler creating object type event

See Also:
  Constant Field Values

#### TYPE_PREPARE

    static final byte TYPE_PREPARE

Profiler event for prepared statements being prepared

See Also:
  Constant Field Values

#### TYPE_QUERY

    static final byte TYPE_QUERY

Profiler event for a query being executed

See Also:
  Constant Field Values

#### TYPE_EXECUTE

    static final byte TYPE_EXECUTE

Profiler event for prepared statements being executed

See Also:
  Constant Field Values

#### TYPE_FETCH

    static final byte TYPE_FETCH

Profiler event for result sets being retrieved

See Also:
  Constant Field Values

#### TYPE_SLOW_QUERY

    static final byte TYPE_SLOW_QUERY

Profiler event for slow query

See Also:
  Constant Field Values

#### NA

    static final byte NA

Not available value.

See Also:
  Constant Field Values

### Method Detail

#### getEventType

    byte getEventType()

Returns the event type

Returns:
  the event type

#### getHostName

    String getHostName()

Returns the host name the event occurred on.

Returns:
  host name

#### getDatabase

    String getDatabase()

Returns the database the event occurred on.

Returns:
  the database in use

#### getConnectionId

    long getConnectionId()

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

Returns:
  the connection in use

#### getStatementId

    int getStatementId()

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

Returns:
  the statement in use

#### getResultSetId

    int getResultSetId()

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

Returns:
  the result set in use

#### getEventCreationTime

    long getEventCreationTime()

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

Returns:
  the time this event was created

#### getEventDuration

    long getEventDuration()

Returns the duration of the event in milliseconds

Returns:
  the duration of the event in milliseconds

#### getDurationUnits

    String getDurationUnits()

Returns the units for getEventDuration()

Returns:
  name of duration units

#### getEventCreationPointAsString

    String getEventCreationPointAsString()

Returns the description of where the event was created.

Returns:
  a description of where this event was created.

#### getMessage

    String getMessage()

Returns the optional message for this event

Returns:
  the message stored in this event

#### pack

    byte[] pack()

Creates a binary representation of this event.

Returns:
  a binary representation of this event

Copyright © 2016, 2023, Oracle and/or its affiliates.