<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="information-schema-innodb-metrics-table">
      </a>
      28.4.21 The INFORMATION_SCHEMA INNODB_METRICS Table
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045076632400">
  </a>
  <p>
   The
   <a class="link" href="information-schema-innodb-metrics-table.html" title="28.4.21 The INFORMATION_SCHEMA INNODB_METRICS Table">
    <code class="literal">
     INNODB_METRICS
    </code>
   </a>
   table provides a
      wide variety of
   <code class="literal">
    InnoDB
   </code>
   performance information,
      complementing the specific focus areas of the Performance Schema
      tables for
   <code class="literal">
    InnoDB
   </code>
   . With simple queries, you can
      check the overall health of the system. With more detailed
      queries, you can diagnose issues such as performance bottlenecks,
      resource shortages, and application issues.
  </p>
  <p>
   Each monitor represents a point within the
   <code class="literal">
    InnoDB
   </code>
   source code that is instrumented to
      gather counter information. Each counter can be started, stopped,
      and reset. You can also perform these actions for a group of
      counters using their common module name.
  </p>
  <p>
   By default, relatively little data is collected. To start, stop,
      and reset counters, set one of the system variables
   <a class="link" href="innodb-parameters.html#sysvar_innodb_monitor_enable">
    <code class="literal">
     innodb_monitor_enable
    </code>
   </a>
   ,
   <a class="link" href="innodb-parameters.html#sysvar_innodb_monitor_disable">
    <code class="literal">
     innodb_monitor_disable
    </code>
   </a>
   ,
   <a class="link" href="innodb-parameters.html#sysvar_innodb_monitor_reset">
    <code class="literal">
     innodb_monitor_reset
    </code>
   </a>
   , or
   <a class="link" href="innodb-parameters.html#sysvar_innodb_monitor_reset_all">
    <code class="literal">
     innodb_monitor_reset_all
    </code>
   </a>
   , using
      the name of the counter, the name of the module, a wildcard match
      for such a name using the
   <span class="quote">
    “
    <span class="quote">
     %
    </span>
    ”
   </span>
   character, or the
      special keyword
   <code class="literal">
    all
   </code>
   .
  </p>
  <p>
   For usage information, see
   <a class="xref" href="innodb-information-schema-metrics-table.html" title="17.15.6 InnoDB INFORMATION_SCHEMA Metrics Table">
    Section 17.15.6, “InnoDB INFORMATION_SCHEMA Metrics Table”
   </a>
   .
  </p>
  <p>
   The
   <a class="link" href="information-schema-innodb-metrics-table.html" title="28.4.21 The INFORMATION_SCHEMA INNODB_METRICS Table">
    <code class="literal">
     INNODB_METRICS
    </code>
   </a>
   table has these
      columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       NAME
      </code>
     </p>
     <p>
      A unique name for the counter.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       SUBSYSTEM
      </code>
     </p>
     <p>
      The aspect of
      <code class="literal">
       InnoDB
      </code>
      that the metric
          applies to.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       COUNT
      </code>
     </p>
     <p>
      The value since the counter was enabled.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       MAX_COUNT
      </code>
     </p>
     <p>
      The maximum value since the counter was enabled.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       MIN_COUNT
      </code>
     </p>
     <p>
      The minimum value since the counter was enabled.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       AVG_COUNT
      </code>
     </p>
     <p>
      The average value since the counter was enabled.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       COUNT_RESET
      </code>
     </p>
     <p>
      The counter value since it was last reset. (The
      <code class="literal">
       _RESET
      </code>
      columns act like the lap counter on
          a stopwatch: you can measure the activity during some time
          interval, while the cumulative figures are still available in
      <code class="literal">
       COUNT
      </code>
      ,
      <code class="literal">
       MAX_COUNT
      </code>
      , and so
          on.)
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       MAX_COUNT_RESET
      </code>
     </p>
     <p>
      The maximum counter value since it was last reset.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       MIN_COUNT_RESET
      </code>
     </p>
     <p>
      The minimum counter value since it was last reset.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       AVG_COUNT_RESET
      </code>
     </p>
     <p>
      The average counter value since it was last reset.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TIME_ENABLED
      </code>
     </p>
     <p>
      The timestamp of the last start.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TIME_DISABLED
      </code>
     </p>
     <p>
      The timestamp of the last stop.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TIME_ELAPSED
      </code>
     </p>
     <p>
      The elapsed time in seconds since the counter started.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TIME_RESET
      </code>
     </p>
     <p>
      The timestamp of the last reset.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       STATUS
      </code>
     </p>
     <p>
      Whether the counter is still running
          (
      <code class="literal">
       enabled
      </code>
      ) or stopped
          (
      <code class="literal">
       disabled
      </code>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TYPE
      </code>
     </p>
     <p>
      Whether the item is a cumulative counter, or measures the
          current value of some resource.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       COMMENT
      </code>
     </p>
     <p>
      The counter description.
     </p>
    </li>
   </ul>
  </div>
  <h4>
   <a name="idm46045076578896">
   </a>
   Example
  </h4>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa82574513"><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-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>INNODB_METRICS <span class="token keyword">WHERE</span> <span class="token keyword">NAME</span><span class="token operator">=</span><span class="token string">'dml_inserts'</span>\G
<span class="token output"><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 1. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
           NAME<span class="token punctuation">:</span> dml_inserts
      SUBSYSTEM<span class="token punctuation">:</span> dml
          COUNT<span class="token punctuation">:</span> 3
      MAX_COUNT<span class="token punctuation">:</span> 3
      MIN_COUNT<span class="token punctuation">:</span> NULL
      AVG_COUNT<span class="token punctuation">:</span> 0.046153846153846156
    COUNT_RESET<span class="token punctuation">:</span> 3
MAX_COUNT_RESET<span class="token punctuation">:</span> 3
MIN_COUNT_RESET<span class="token punctuation">:</span> NULL
AVG_COUNT_RESET<span class="token punctuation">:</span> NULL
   TIME_ENABLED<span class="token punctuation">:</span> 2014-12-04 14<span class="token punctuation">:</span>18<span class="token punctuation">:</span>28
  TIME_DISABLED<span class="token punctuation">:</span> NULL
   TIME_ELAPSED<span class="token punctuation">:</span> 65
     TIME_RESET<span class="token punctuation">:</span> NULL
         STATUS<span class="token punctuation">:</span> enabled
           TYPE<span class="token punctuation">:</span> status_counter
        COMMENT<span class="token punctuation">:</span> Number of rows inserted</span></code></pre>
  </div>
  <h4>
   <a name="idm46045076576016">
   </a>
   Notes
  </h4>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      You must have the
      <a class="link" href="privileges-provided.html#priv_process">
       <code class="literal">
        PROCESS
       </code>
      </a>
      privilege to query this table.
     </p>
    </li>
    <li class="listitem">
     <p>
      Use the
      <code class="literal">
       INFORMATION_SCHEMA
      </code>
      <a class="link" href="information-schema-columns-table.html" title="28.3.8 The INFORMATION_SCHEMA COLUMNS Table">
       <code class="literal">
        COLUMNS
       </code>
      </a>
      table or the
      <a class="link" href="show-columns.html" title="15.7.7.6 SHOW COLUMNS Statement">
       <code class="literal">
        SHOW COLUMNS
       </code>
      </a>
      statement to view
          additional information about the columns of this table,
          including data types and default values.
     </p>
    </li>
    <li class="listitem">
     <p>
      Transaction counter
      <code class="literal">
       COUNT
      </code>
      values may differ
          from the number of transaction events reported in Performance
          Schema
      <code class="literal">
       EVENTS_TRANSACTIONS_SUMMARY
      </code>
      tables.
      <code class="literal">
       InnoDB
      </code>
      counts only those transactions that
          it executes, whereas Performance Schema collects events for
          all non-aborted transactions initiated by the server,
          including empty transactions.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
