5.7.1.2. Command Probes

The command probes are executed before and after a client command is executed, including any SQL statement that might be executed during that period. Commands include operations such as the initialization of the DB, use of the COM_CHANGE_USER operation (supported by the MySQL protocol), and manipulation of prepared statements. Many of these commands are used only by the MySQL client API from various connectors such as PHP and Java.

command-start(connectionid, command, user, host)
command-done(status)
  • command-start: Triggered when a command is submitted to the server.

    • connectionid: The connection ID of the client executing the command.

    • command: An integer representing the command that was executed. Possible values are shown in the following table.

      ValueNameDescription
      00COM_SLEEPInternal thread state
      01COM_QUITClose connection
      02COM_INIT_DBSelect database (USE ...)
      03COM_QUERYExecute a query
      04COM_FIELD_LISTGet a list of fields
      05COM_CREATE_DBCreate a database (deprecated)
      06COM_DROP_DBDrop a database (deprecated)
      07COM_REFRESHRefresh connection
      08COM_SHUTDOWNShutdown server
      09COM_STATISTICSGet statistics
      10COM_PROCESS_INFOGet processes (SHOW PROCESSLIST)
      11COM_CONNECTInitialize connection
      12COM_PROCESS_KILLKill process
      13COM_DEBUGGet debug information
      14COM_PINGPing
      15COM_TIMEInternal thread state
      16COM_DELAYED_INSERTInternal thread state
      17COM_CHANGE_USERChange user
      18COM_BINLOG_DUMPUsed by a replication slave or mysqlbinlog to initiate a binary log read
      19COM_TABLE_DUMPUsed by a replication slave to get the master table information
      20COM_CONNECT_OUTUsed by a replication slave to log a connection to the server
      21COM_REGISTER_SLAVEUsed by a replication slave during registration
      22COM_STMT_PREPAREPrepare a statement
      23COM_STMT_EXECUTEExecute a statement
      24COM_STMT_SEND_LONG_DATAUsed by a client when requesting extended data
      25COM_STMT_CLOSEClose a prepared statement
      26COM_STMT_RESETReset a prepared statement
      27COM_SET_OPTIONSet a server option
      28COM_STMT_FETCHFetch a prepared statement
    • user: The user executing the command.

    • host: The client host.

  • command-done: Triggered when the command execution completes. The status argument contains 0 if the command executed successfully, or 1 if the statement was terminated before normal completion.

The command-start and command-done probes are best used when combined with the statement probes to get an idea of overall execution time.

Copyright © 2010-2024 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout