Databases Reference
In-Depth Information
press Enter a few times. Once connected, you'll be in T (InnoDB Transaction) mode,
and you should see a list of InnoDB transactions, as shown in
Figure 16-1
.
Figure 16-1. innotop in T (Transaction) mode
By default,
innotop
applies filters to reduce the clutter (as with everything in
innotop
,
you can define your own or customize the built-in filters). In
Figure 16-1
, most of the
transactions have been filtered out to show only active transactions. You can press the
i
key to disable the filter and fill the screen with as many transactions as will fit.
innotop
displays a header and a main thread list in this mode. The header shows some
overall InnoDB information, such as the length of the history list, the number of un-
purged InnoDB transactions, the percentage of dirty buffers in the buffer pool, and so
forth.
The first key you should press is the question mark (?), to see the help screen. This
screen's contents will vary depending on what mode
innotop
is in, but it always displays
every active key, so you can see all possible actions.
Figure 16-2
shows the help screen
in T mode.
We won't go through all of its other modes, but as you can see from the help screen,
innotop
has a lot of features.
The only other thing we cover here is some basic customization to show you how to
monitor whatever you please. One of
innotop
's strengths is its ability to interpret user-
defined expressions, such as
Uptime/Questions
to derive a queries-per-second metric.
It can display the result since the server was started and/or incrementally since the last
sample.
This makes it easy to add your own columns to its tabular displays. For example, the
Q (Query List) mode has a header that shows some overall server information. Let's
see how to modify it to monitor how full the key cache is. Start
innotop
and press
Q
to
enter Q mode. The result will look like
Figure 16-3
.
The screenshot is truncated because we're not interested in the query list for this ex-
ercise; we care only about the header.