mk-profile-compact1p
Compact the output from mk-query-profiler.
Usage
To view
queries
2,
4
and
6
side
by
side:
mk-profile-compact --queries
2,4,6
profile-results.txt
To view
summaries
from
two
runs
side
by
side:
mk-profile-compact --mode
SUMMARY
results-1.txt
results-2.txt
Risks
The following section is included to inform users about the potential risks, whether known or unknown, of using this tool. The two main categories of risks are those created by the nature of the tool (e.g. read-only tools vs. read-write tools) and those created by bugs.
mk-profile-compact is read-only and very low-risk.
At the time of this release, we know of no bugs that could cause serious harm to users.
The authoritative source for updated information is always the online issue tracking system. Issues that affect this tool will be marked as such. You can see a list of such issues at the following URL: <http://www.maatkit.org/bugs/mk-profile-compact>.
See also "BUGS" for more information on filing bugs and getting help.
Overview
mk-profile-compact slices and aligns the output from mk-query-profiler so you can compare profile results side by side easily. It prints the first profile result intact, but each subsequent result is trimmed to be as narrow as possible, then aligned next to the first.
You can also use this to examine only some profile results. For example, if you have a set of queries to get a table into a known state, and then a query you want to profile, you can ignore the setup queries. This is typically easy to do with a command-line option like "--queries" 4,8,12,16,20 to view every 4th query.
If the first profile it sees is labeled QUERY X, it will only look at QUERY profiles from then on. The same holds for SUMMARY profiles. This is because there are different numbers of lines in QUERY and SUMMARY profiles. You can specify which kind of profile result you want to process. See mk-query-profiler for the full list of types.
Options
-
--config -
type: Array
Read this comma-separated list of config files; if specified, this must be the first option on the command line.
-
--headers -
type: int; default: 2000
Reprint headers every N queries.
-
--help -
Show help and exit.
-
--mode -
type: string
What type of reports (EXTERNAL, QUERY, SUMMARY) to process.
-
--queries -
type: hash
Process only this comma-separated list of queries.
-
--version -
Show version and exit.
Downloading
You can download Maatkit from Google Code at <http://code.google.com/p/maatkit/>, or you can get any of the tools easily with a command like the following:
wget http://www.maatkit.org/get/toolnameorwget http://www.maatkit.org/trunk/toolname
Where "toolname" can be replaced with the name (or fragment of a name) of any of the Maatkit tools. Once downloaded, they're ready to run; no installation is needed. The first URL gets the latest released version of the tool, and the second gets the latest trunk code from Subversion.
Environment
The environment variable "MKDEBUG" enables verbose debugging output in all of the Maatkit tools:
MKDEBUG=1 mk-....
System requirements
You need Perl and some core packages that ought to be installed in any reasonably new version of Perl.
Copyright, license and warranty
This program is copyright 2007-2010 Baron Schwartz. Feedback and improvements are welcome.
THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2; OR the Perl Artistic License. On UNIX and similar systems, you can issue `man perlgpl' or `man perlartistic' to read these licenses.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
About maatkit
This tool is part of Maatkit, a toolkit for power users of MySQL. Maatkit was created by Baron Schwartz; Baron and Daniel Nichter are the primary code contributors. Both are employed by Percona. Financial support for Maatkit development is primarily provided by Percona and its clients.
Version
This manual page documents Ver 1.1.22 Distrib 6652 $Revision: 6453 $.
Releases
2 releases since Debian 5.0 (Lenny); the text changed 1 time.
--config since Debian 6.0 (Squeeze).