<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="performance-schema-instrument-naming">
      </a>
      29.6 Performance Schema Instrument Naming Conventions
     </h2>
    </div>
   </div>
  </div>
  <p>
   An instrument name consists of a sequence of elements separated by
   <code class="literal">
    '/'
   </code>
   characters. Example names:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-none"><div class="docs-select-all right" id="sa75729489"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-none">wait/io/file/myisam/log
wait/io/file/mysys/charset
wait/lock/table/sql/handler
wait/synch/cond/mysys/COND_alarm
wait/synch/cond/sql/BINLOG::update_cond
wait/synch/mutex/mysys/BITMAP_mutex
wait/synch/mutex/sql/LOCK_delete
wait/synch/rwlock/sql/Query_cache_query::lock
stage/sql/closing tables
stage/sql/Sorting result
statement/com/Execute
statement/com/Query
statement/sql/create_table
statement/sql/lock_tables
errors</code></pre>
  </div>
  <p>
   The instrument name space has a tree-like structure. The elements
      of an instrument name from left to right provide a progression
      from more general to more specific. The number of elements a name
      has depends on the type of instrument.
  </p>
  <p>
   The interpretation of a given element in a name depends on the
      elements to the left of it. For example,
   <code class="literal">
    myisam
   </code>
   appears in both of the following names, but
   <code class="literal">
    myisam
   </code>
   in the first name is related to file
      I/O, whereas in the second it is related to a synchronization
      instrument:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-none"><div class="docs-select-all right" id="sa43228060"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-none">wait/io/file/myisam/log
wait/synch/cond/myisam/MI_SORT_INFO::cond</code></pre>
  </div>
  <p>
   Instrument names consist of a prefix with a structure defined by
      the Performance Schema implementation and a suffix defined by the
      developer implementing the instrument code. The top-level element
      of an instrument prefix indicates the type of instrument. This
      element also determines which event timer in the
   <a class="link" href="performance-schema-performance-timers-table.html" title="29.12.22.6 The performance_timers Table">
    <code class="literal">
     performance_timers
    </code>
   </a>
   table applies to
      the instrument. For the prefix part of instrument names, the top
      level indicates the type of instrument.
  </p>
  <p>
   The suffix part of instrument names comes from the code for the
      instruments themselves. Suffixes may include levels such as these:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      A name for the major element (a server module such as
      <code class="literal">
       myisam
      </code>
      ,
      <code class="literal">
       innodb
      </code>
      ,
      <code class="literal">
       mysys
      </code>
      , or
      <code class="literal">
       sql
      </code>
      ) or a
          plugin name.
     </p>
    </li>
    <li class="listitem">
     <p>
      The name of a variable in the code, in the form
      <em class="replaceable">
       <code>
        XXX
       </code>
      </em>
      (a global variable) or
      <code class="literal">
       <em class="replaceable">
        <code>
         CCC
        </code>
       </em>
       ::
       <em class="replaceable">
        <code>
         MMM
        </code>
       </em>
      </code>
      (a member
      <em class="replaceable">
       <code>
        MMM
       </code>
      </em>
      in class
      <em class="replaceable">
       <code>
        CCC
       </code>
      </em>
      ). Examples:
      <code class="literal">
       COND_thread_cache
      </code>
      ,
      <code class="literal">
       THR_LOCK_myisam
      </code>
      ,
      <code class="literal">
       BINLOG::LOCK_index
      </code>
      .
     </p>
    </li>
   </ul>
  </div>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="xref" href="performance-schema-instrument-naming.html#performance-schema-top-level-instrument-elements" title="Top-Level Instrument Elements">
       Top-Level Instrument Elements
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="performance-schema-instrument-naming.html#performance-schema-idle-instrument-elements" title="Idle Instrument Elements">
       Idle Instrument Elements
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="performance-schema-instrument-naming.html#performance-schema-error-instrument-elements" title="Error Instrument Elements">
       Error Instrument Elements
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="performance-schema-instrument-naming.html#performance-schema-memory-instrument-elements" title="Memory Instrument Elements">
       Memory Instrument Elements
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="performance-schema-instrument-naming.html#performance-schema-stage-instrument-elements" title="Stage Instrument Elements">
       Stage Instrument Elements
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="performance-schema-instrument-naming.html#performance-schema-statement-instrument-elements" title="Statement Instrument Elements">
       Statement Instrument Elements
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="performance-schema-instrument-naming.html#performance-schema-thread-instrument-elements" title="Thread Instrument Elements">
       Thread Instrument Elements
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="performance-schema-instrument-naming.html#performance-schema-wait-instrument-elements" title="Wait Instrument Elements">
       Wait Instrument Elements
      </a>
     </p>
    </li>
   </ul>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h3 class="title">
       <a name="performance-schema-top-level-instrument-elements">
       </a>
       Top-Level Instrument Elements
      </h3>
     </div>
    </div>
   </div>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <code class="literal">
        idle
       </code>
       : An instrumented idle event. This
            instrument has no further elements.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        error
       </code>
       : An instrumented error event. This
            instrument has no further elements.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        memory
       </code>
       : An instrumented memory event.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        stage
       </code>
       : An instrumented stage event.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        statement
       </code>
       : An instrumented statement
            event.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        transaction
       </code>
       : An instrumented transaction
            event. This instrument has no further elements.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        wait
       </code>
       : An instrumented wait event.
      </p>
     </li>
    </ul>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h3 class="title">
       <a name="performance-schema-idle-instrument-elements">
       </a>
       Idle Instrument Elements
      </h3>
     </div>
    </div>
   </div>
   <p>
    The
    <code class="literal">
     idle
    </code>
    instrument is used for idle events,
        which The Performance Schema generates as discussed in the
        description of the
    <code class="literal">
     socket_instances.STATE
    </code>
    column in
    <a class="xref" href="performance-schema-socket-instances-table.html" title="29.12.3.5 The socket_instances Table">
     Section 29.12.3.5, “The socket_instances Table”
    </a>
    .
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h3 class="title">
       <a name="performance-schema-error-instrument-elements">
       </a>
       Error Instrument Elements
      </h3>
     </div>
    </div>
   </div>
   <p>
    The
    <code class="literal">
     error
    </code>
    instrument indicates whether to
        collect information for server errors and warnings. This
        instrument is enabled by default. The
    <code class="literal">
     TIMED
    </code>
    column for the
    <code class="literal">
     error
    </code>
    row in the
    <a class="link" href="performance-schema-setup-instruments-table.html" title="29.12.2.3 The setup_instruments Table">
     <code class="literal">
      setup_instruments
     </code>
    </a>
    table is
        inapplicable because timing information is not collected.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h3 class="title">
       <a name="performance-schema-memory-instrument-elements">
       </a>
       Memory Instrument Elements
      </h3>
     </div>
    </div>
   </div>
   <p>
    Memory instrumentation is enabled by default. Memory
        instrumentation can be enabled or disabled at startup, or
        dynamically at runtime by updating the
    <code class="literal">
     ENABLED
    </code>
    column of the relevant instruments in
        the
    <a class="link" href="performance-schema-setup-instruments-table.html" title="29.12.2.3 The setup_instruments Table">
     <code class="literal">
      setup_instruments
     </code>
    </a>
    table. Memory
        instruments have names of the form
    <code class="literal">
     memory/
     <em class="replaceable">
      <code>
       code_area
      </code>
     </em>
     /
     <em class="replaceable">
      <code>
       instrument_name
      </code>
     </em>
    </code>
    where
    <em class="replaceable">
     <code>
      code_area
     </code>
    </em>
    is a value such as
    <code class="literal">
     sql
    </code>
    or
    <code class="literal">
     myisam
    </code>
    , and
    <em class="replaceable">
     <code>
      instrument_name
     </code>
    </em>
    is the instrument
        detail.
   </p>
   <p>
    Instruments named with the prefix
    <code class="literal">
     memory/performance_schema/
    </code>
    expose how much
        memory is allocated for internal buffers in the Performance
        Schema. The
    <code class="literal">
     memory/performance_schema/
    </code>
    instruments are built in, always enabled, and cannot be disabled
        at startup or runtime. Built-in memory instruments are displayed
        only in the
    <a class="link" href="performance-schema-memory-summary-tables.html" title="29.12.20.10 Memory Summary Tables">
     <code class="literal">
      memory_summary_global_by_event_name
     </code>
    </a>
    table. For more information, see
    <a class="xref" href="performance-schema-memory-model.html" title="29.17 The Performance Schema Memory-Allocation Model">
     Section 29.17, “The Performance Schema Memory-Allocation Model”
    </a>
    .
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h3 class="title">
       <a name="performance-schema-stage-instrument-elements">
       </a>
       Stage Instrument Elements
      </h3>
     </div>
    </div>
   </div>
   <p>
    Stage instruments have names of the form
    <code class="literal">
     stage/
     <em class="replaceable">
      <code>
       code_area
      </code>
     </em>
     /
     <em class="replaceable">
      <code>
       stage_name
      </code>
     </em>
    </code>
    ,
        where
    <em class="replaceable">
     <code>
      code_area
     </code>
    </em>
    is a value such as
    <code class="literal">
     sql
    </code>
    or
    <code class="literal">
     myisam
    </code>
    , and
    <em class="replaceable">
     <code>
      stage_name
     </code>
    </em>
    indicates the stage of
        statement processing, such as
    <code class="literal">
     Sorting result
    </code>
    or
    <code class="literal">
     Sending data
    </code>
    . Stages correspond to the
        thread states displayed by
    <a class="link" href="show-processlist.html" title="15.7.7.31 SHOW PROCESSLIST Statement">
     <code class="literal">
      SHOW
        PROCESSLIST
     </code>
    </a>
    or that are visible in the Information
        Schema
    <a class="link" href="information-schema-processlist-table.html" title="28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table">
     <code class="literal">
      PROCESSLIST
     </code>
    </a>
    table.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h3 class="title">
       <a name="performance-schema-statement-instrument-elements">
       </a>
       Statement Instrument Elements
      </h3>
     </div>
    </div>
   </div>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <code class="literal">
        statement/abstract/*
       </code>
       : An abstract
            instrument for statement operations. Abstract instruments
            are used during the early stages of statement classification
            before the exact statement type is known, then changed to a
            more specific statement instrument when the type is known.
            For a description of this process, see
       <a class="xref" href="performance-schema-statement-tables.html" title="29.12.6 Performance Schema Statement Event Tables">
        Section 29.12.6, “Performance Schema Statement Event Tables”
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        statement/com
       </code>
       : An instrumented command
            operation. These have names corresponding to
       <code class="literal">
        COM_
        <em class="replaceable">
         <code>
          xxx
         </code>
        </em>
       </code>
       operations (see the
       <code class="filename">
        mysql_com.h
       </code>
       header
            file and
       <code class="filename">
        sql/sql_parse.cc
       </code>
       . For example,
            the
       <code class="literal">
        statement/com/Connect
       </code>
       and
       <code class="literal">
        statement/com/Init DB
       </code>
       instruments
            correspond to the
       <code class="literal">
        COM_CONNECT
       </code>
       and
       <code class="literal">
        COM_INIT_DB
       </code>
       commands.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        statement/scheduler/event
       </code>
       : A single
            instrument to track all events executed by the Event
            Scheduler. This instrument comes into play when a scheduled
            event begins executing.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        statement/sp
       </code>
       : An instrumented internal
            instruction executed by a stored program. For example, the
       <code class="literal">
        statement/sp/cfetch
       </code>
       and
       <code class="literal">
        statement/sp/freturn
       </code>
       instruments are used
            cursor fetch and function return instructions.
      </p>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        statement/sql
       </code>
       : An instrumented SQL
            statement operation. For example, the
       <code class="literal">
        statement/sql/create_db
       </code>
       and
       <code class="literal">
        statement/sql/select
       </code>
       instruments are used
            for
       <a class="link" href="create-database.html" title="15.1.12 CREATE DATABASE Statement">
        <code class="literal">
         CREATE DATABASE
        </code>
       </a>
       and
       <a class="link" href="select.html" title="15.2.13 SELECT Statement">
        <code class="literal">
         SELECT
        </code>
       </a>
       statements.
      </p>
     </li>
    </ul>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h3 class="title">
       <a name="performance-schema-thread-instrument-elements">
       </a>
       Thread Instrument Elements
      </h3>
     </div>
    </div>
   </div>
   <p>
    Instrumented threads are displayed in the
    <a class="link" href="performance-schema-setup-threads-table.html" title="29.12.2.5 The setup_threads Table">
     <code class="literal">
      setup_threads
     </code>
    </a>
    table, which exposes
        thread class names and attributes.
   </p>
   <p>
    Thread instruments begin with
    <code class="literal">
     thread
    </code>
    (for
        example,
    <code class="literal">
     thread/sql/parser_service
    </code>
    or
    <code class="literal">
     thread/performance_schema/setup
    </code>
    ).
   </p>
   <p>
    The names of thread instruments for
    <code class="literal">
     ndbcluster
    </code>
    plugin threads begin with
    <code class="literal">
     thread/ndbcluster/
    </code>
    ; for more information
        about these, see
    <a class="xref" href="mysql-cluster-ps-tables.html#mysql-cluster-plugin-threads" title="ndbcluster Plugin Threads">
     ndbcluster Plugin Threads
    </a>
    .
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h3 class="title">
       <a name="performance-schema-wait-instrument-elements">
       </a>
       Wait Instrument Elements
      </h3>
     </div>
    </div>
   </div>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <code class="literal">
        wait/io
       </code>
      </p>
      <p>
       An instrumented I/O operation.
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          <code class="literal">
           wait/io/file
          </code>
         </p>
         <p>
          An instrumented file I/O operation. For files, the wait
                is the time waiting for the file operation to complete
                (for example, a call to
          <code class="literal">
           fwrite()
          </code>
          ).
                Due to caching, the physical file I/O on the disk might
                not happen within this call.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           wait/io/socket
          </code>
         </p>
         <p>
          An instrumented socket operation. Socket instruments
                have names of the form
          <code class="literal">
           wait/io/socket/sql/
           <em class="replaceable">
            <code>
             socket_type
            </code>
           </em>
          </code>
          .
                The server has a listening socket for each network
                protocol that it supports. The instruments associated
                with listening sockets for TCP/IP or Unix socket file
                connections have a
          <em class="replaceable">
           <code>
            socket_type
           </code>
          </em>
          value of
          <code class="literal">
           server_tcpip_socket
          </code>
          or
          <code class="literal">
           server_unix_socket
          </code>
          , respectively.
                When a listening socket detects a connection, the server
                transfers the connection to a new socket managed by a
                separate thread. The instrument for the new connection
                thread has a
          <em class="replaceable">
           <code>
            socket_type
           </code>
          </em>
          value of
          <code class="literal">
           client_connection
          </code>
          .
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           wait/io/table
          </code>
         </p>
         <p>
          An instrumented table I/O operation. These include
                row-level accesses to persistent base tables or
                temporary tables. Operations that affect rows are fetch,
                insert, update, and delete. For a view, waits are
                associated with base tables referenced by the view.
         </p>
         <p>
          Unlike most waits, a table I/O wait can include other
                waits. For example, table I/O might include file I/O or
                memory operations. Thus,
          <a class="link" href="performance-schema-events-waits-current-table.html" title="29.12.4.1 The events_waits_current Table">
           <code class="literal">
            events_waits_current
           </code>
          </a>
          for a
                table I/O wait usually has two rows. For more
                information, see
          <a class="xref" href="performance-schema-atom-molecule-events.html" title="29.8 Performance Schema Atom and Molecule Events">
           Section 29.8, “Performance Schema Atom and Molecule Events”
          </a>
          .
         </p>
         <p>
          Some row operations might cause multiple table I/O
                waits. For example, an insert might activate a trigger
                that causes an update.
         </p>
        </li>
       </ul>
      </div>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        wait/lock
       </code>
      </p>
      <p>
       An instrumented lock operation.
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          <code class="literal">
           wait/lock/table
          </code>
         </p>
         <p>
          An instrumented table lock operation.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           wait/lock/metadata/sql/mdl
          </code>
         </p>
         <p>
          An instrumented metadata lock operation.
         </p>
        </li>
       </ul>
      </div>
     </li>
     <li class="listitem">
      <p>
       <code class="literal">
        wait/synch
       </code>
      </p>
      <p>
       An instrumented synchronization object. For synchronization
            objects, the
       <code class="literal">
        TIMER_WAIT
       </code>
       time includes the
            amount of time blocked while attempting to acquire a lock on
            the object, if any.
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          <code class="literal">
           wait/synch/cond
          </code>
         </p>
         <p>
          A condition is used by one thread to signal to other
                threads that something they were waiting for has
                happened. If a single thread was waiting for a
                condition, it can wake up and proceed with its
                execution. If several threads were waiting, they can all
                wake up and compete for the resource for which they were
                waiting.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           wait/synch/mutex
          </code>
         </p>
         <p>
          A mutual exclusion object used to permit access to a
                resource (such as a section of executable code) while
                preventing other threads from accessing the resource.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           wait/synch/prlock
          </code>
         </p>
         <p>
          A priority
          <a class="link" href="glossary.html#glos_rw_lock" title="rw-lock">
           rwlock
          </a>
          lock object.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           wait/synch/rwlock
          </code>
         </p>
         <p>
          A plain
          <a class="link" href="glossary.html#glos_rw_lock" title="rw-lock">
           read/write
                lock
          </a>
          object used to lock a specific variable for
                access while preventing its use by other threads. A
                shared read lock can be acquired simultaneously by
                multiple threads. An exclusive write lock can be
                acquired by only one thread at a time.
         </p>
        </li>
        <li class="listitem">
         <p>
          <code class="literal">
           wait/synch/sxlock
          </code>
         </p>
         <p>
          A shared-exclusive (SX) lock is a type of
          <a class="link" href="glossary.html#glos_rw_lock" title="rw-lock">
           rwlock
          </a>
          lock object
                that provides write access to a common resource while
                permitting inconsistent reads by other threads.
          <code class="literal">
           sxlocks
          </code>
          optimize concurrency and
                improve scalability for read-write workloads.
         </p>
        </li>
       </ul>
      </div>
     </li>
    </ul>
   </div>
  </div>
 </div>
 <br/>
</div>
