<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Xaprb &#187; mext</title>
	<atom:link href="http://www.xaprb.com/blog/tag/mext/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xaprb.com/blog</link>
	<description>Stay curious!</description>
	<lastBuildDate>Thu, 09 Feb 2012 03:58:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Using mext to format saved mysqladmin output nicely</title>
		<link>http://www.xaprb.com/blog/2009/10/13/using-mext-to-format-saved-mysqladmin-output-nicely/</link>
		<comments>http://www.xaprb.com/blog/2009/10/13/using-mext-to-format-saved-mysqladmin-output-nicely/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 01:00:04 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[mext]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1341</guid>
		<description><![CDATA[I wrote a while ago about how mext works &#8212; it runs &#8220;mysqladmin extended-status&#8221; and formats it nicely. But what if you want to use it to format saved output that you&#8217;ve put into a file? It&#8217;s actually very easy. You can tell it what command-line to run to generate its input. By default you [...]


<strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2009/04/11/formatting-mysqladmin-extended-status-nicely/' rel='bookmark' title='Permanent Link: Formatting mysqladmin extended-status nicely'>Formatting mysqladmin extended-status nicely</a></li>
<li><a href='http://www.xaprb.com/blog/2009/06/05/a-tweak-to-column-alignment-for-the-mext-script/' rel='bookmark' title='Permanent Link: A tweak to column alignment for the mext script'>A tweak to column alignment for the mext script</a></li>
<li><a href='http://www.xaprb.com/blog/2006/04/13/using-awk-to-convert-mysql-output-to-tables/' rel='bookmark' title='Permanent Link: How to convert MySQL output to HTML tables'>How to convert MySQL output to HTML tables</a></li>
<li><a href='http://www.xaprb.com/blog/2009/02/19/strangest-datetime-format-ever/' rel='bookmark' title='Permanent Link: Strangest datetime format ever'>Strangest datetime format ever</a></li>
<li><a href='http://www.xaprb.com/blog/2006/01/05/javascript-number-formatting/' rel='bookmark' title='Permanent Link: How to format numbers in JavaScript flexibly and efficiently'>How to format numbers in JavaScript flexibly and efficiently</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>I wrote a while ago about how <a href="http://www.xaprb.com/blog/2009/04/11/formatting-mysqladmin-extended-status-nicely/">mext</a> works &#8212; it runs &#8220;mysqladmin extended-status&#8221; and formats it nicely.  But what if you want to use it to format <em>saved</em> output that you&#8217;ve put into a file?  It&#8217;s actually very easy.  You can tell it what command-line to run to generate its input.  By default you are probably going to tell it to run &#8220;mysqladmin ext -ri10&#8243; or something like that, but you can just as easily make it run &#8220;cat my-saved-output&#8221;.</p>

<p>Let&#8217;s see how this can be useful.  Imagine I have a server that stalls every now and then, and I&#8217;ve set up mk-loadavg to watch for this and capture information about system activity with a script that contains</p>

<pre>$ mysqladmin ext -c 30 -i1 > mysqladmin-output.txt</pre>

<p>That&#8217;ll gather 30 samples one second apart.  Now I&#8217;ll format it:</p>

<pre>
$ wget -q http://www.maatkit.org/mext
$ sh mext -r -- cat mysqladmin-output.txt | less -S
</pre>

<p>I&#8217;m piping the output into less -S so that I can see unwrapped output.  30 samples of mysql status variables are going to be aligned in columns next to each other, so without the -S flag I&#8217;ll probably see something unhelpful.</p>

<p>If you have a hard time visualizing the above, go ahead and run the commands!  It&#8217;ll take only a minute, and it&#8217;ll make a lot more sense to you then.  This is a really useful way to summarize and understand what is going on (or has gone on) inside your MySQL server.</p>

<p><strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2009/04/11/formatting-mysqladmin-extended-status-nicely/' rel='bookmark' title='Permanent Link: Formatting mysqladmin extended-status nicely'>Formatting mysqladmin extended-status nicely</a></li>
<li><a href='http://www.xaprb.com/blog/2009/06/05/a-tweak-to-column-alignment-for-the-mext-script/' rel='bookmark' title='Permanent Link: A tweak to column alignment for the mext script'>A tweak to column alignment for the mext script</a></li>
<li><a href='http://www.xaprb.com/blog/2006/04/13/using-awk-to-convert-mysql-output-to-tables/' rel='bookmark' title='Permanent Link: How to convert MySQL output to HTML tables'>How to convert MySQL output to HTML tables</a></li>
<li><a href='http://www.xaprb.com/blog/2009/02/19/strangest-datetime-format-ever/' rel='bookmark' title='Permanent Link: Strangest datetime format ever'>Strangest datetime format ever</a></li>
<li><a href='http://www.xaprb.com/blog/2006/01/05/javascript-number-formatting/' rel='bookmark' title='Permanent Link: How to format numbers in JavaScript flexibly and efficiently'>How to format numbers in JavaScript flexibly and efficiently</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2009/10/13/using-mext-to-format-saved-mysqladmin-output-nicely/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A tweak to column alignment for the mext script</title>
		<link>http://www.xaprb.com/blog/2009/06/05/a-tweak-to-column-alignment-for-the-mext-script/</link>
		<comments>http://www.xaprb.com/blog/2009/06/05/a-tweak-to-column-alignment-for-the-mext-script/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 17:50:46 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[mext]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=1112</guid>
		<description><![CDATA[I tweaked the mext script so it auto-detects the necessary column widths for each sample. Get mext here. Further Reading:Using mext to format saved mysqladmin output nicely SHOW COLUMN TYPES: A hidden MySQL treat? How to choose SQL column types: a case study A script snippet for aggregating GDB backtraces A script snippet to relative-ize [...]


<strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2009/10/13/using-mext-to-format-saved-mysqladmin-output-nicely/' rel='bookmark' title='Permanent Link: Using mext to format saved mysqladmin output nicely'>Using mext to format saved mysqladmin output nicely</a></li>
<li><a href='http://www.xaprb.com/blog/2006/09/19/show-column-types-a-hidden-mysql-treat/' rel='bookmark' title='Permanent Link: SHOW COLUMN TYPES: A hidden MySQL treat?'>SHOW COLUMN TYPES: A hidden MySQL treat?</a></li>
<li><a href='http://www.xaprb.com/blog/2006/02/07/how-to-choose-sql-column-types/' rel='bookmark' title='Permanent Link: How to choose SQL column types: a case study'>How to choose SQL column types: a case study</a></li>
<li><a href='http://www.xaprb.com/blog/2009/08/30/a-script-snippet-for-aggregating-gdb-backtraces/' rel='bookmark' title='Permanent Link: A script snippet for aggregating GDB backtraces'>A script snippet for aggregating GDB backtraces</a></li>
<li><a href='http://www.xaprb.com/blog/2009/09/01/a-script-snippet-to-relative-ize-numbers-embedded-in-text/' rel='bookmark' title='Permanent Link: A script snippet to relative-ize numbers embedded in text'>A script snippet to relative-ize numbers embedded in text</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>I tweaked the <a href="http://www.xaprb.com/blog/2009/04/11/formatting-mysqladmin-extended-status-nicely/">mext</a> script so it auto-detects the necessary column widths for each sample.</p>

<a href="http://www.xaprb.com/mext">Get mext here</a>.</p>

<p><strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2009/10/13/using-mext-to-format-saved-mysqladmin-output-nicely/' rel='bookmark' title='Permanent Link: Using mext to format saved mysqladmin output nicely'>Using mext to format saved mysqladmin output nicely</a></li>
<li><a href='http://www.xaprb.com/blog/2006/09/19/show-column-types-a-hidden-mysql-treat/' rel='bookmark' title='Permanent Link: SHOW COLUMN TYPES: A hidden MySQL treat?'>SHOW COLUMN TYPES: A hidden MySQL treat?</a></li>
<li><a href='http://www.xaprb.com/blog/2006/02/07/how-to-choose-sql-column-types/' rel='bookmark' title='Permanent Link: How to choose SQL column types: a case study'>How to choose SQL column types: a case study</a></li>
<li><a href='http://www.xaprb.com/blog/2009/08/30/a-script-snippet-for-aggregating-gdb-backtraces/' rel='bookmark' title='Permanent Link: A script snippet for aggregating GDB backtraces'>A script snippet for aggregating GDB backtraces</a></li>
<li><a href='http://www.xaprb.com/blog/2009/09/01/a-script-snippet-to-relative-ize-numbers-embedded-in-text/' rel='bookmark' title='Permanent Link: A script snippet to relative-ize numbers embedded in text'>A script snippet to relative-ize numbers embedded in text</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2009/06/05/a-tweak-to-column-alignment-for-the-mext-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Formatting mysqladmin extended-status nicely</title>
		<link>http://www.xaprb.com/blog/2009/04/11/formatting-mysqladmin-extended-status-nicely/</link>
		<comments>http://www.xaprb.com/blog/2009/04/11/formatting-mysqladmin-extended-status-nicely/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 15:41:28 +0000</pubDate>
		<dc:creator>Xaprb</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[mext]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ryan Lowe]]></category>

		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=890</guid>
		<description><![CDATA[I always say that the ultimate MySQL tuning script is an expert human. To that end, I generally try to build tools that help a human be more productive with the raw information from MySQL. One of the things we look at during a performance audit is the MySQL status counters. It&#8217;s useful to look [...]


<strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2009/10/13/using-mext-to-format-saved-mysqladmin-output-nicely/' rel='bookmark' title='Permanent Link: Using mext to format saved mysqladmin output nicely'>Using mext to format saved mysqladmin output nicely</a></li>
<li><a href='http://www.xaprb.com/blog/2009/06/07/extended-covering-indexes/' rel='bookmark' title='Permanent Link: Extended covering indexes'>Extended covering indexes</a></li>
<li><a href='http://www.xaprb.com/blog/2007/06/25/javascript-formatting-library-update/' rel='bookmark' title='Permanent Link: JavaScript formatting library update'>JavaScript formatting library update</a></li>
<li><a href='http://www.xaprb.com/blog/2009/06/05/a-tweak-to-column-alignment-for-the-mext-script/' rel='bookmark' title='Permanent Link: A tweak to column alignment for the mext script'>A tweak to column alignment for the mext script</a></li>
<li><a href='http://www.xaprb.com/blog/2006/08/12/how-to-monitor-mysql-status-and-variables-with-innotop/' rel='bookmark' title='Permanent Link: How to monitor MySQL status and variables with innotop'>How to monitor MySQL status and variables with innotop</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>I always say that the ultimate MySQL tuning script is an expert human.  To that end, I generally try to build tools that help a human be more productive with the raw information from MySQL.  One of the things <a href="http://www.mysqlperformanceblog.com/2008/11/24/how-percona-does-a-mysql-performance-audit/">we look at during a performance audit</a> is the MySQL status counters.  It&#8217;s useful to look at a) absolute values and b) several incremental snapshots.  I&#8217;ve written a small shell script called &#8220;mext&#8221; that can make this a little easier.</p>

<p>It looks like this:</p>

<pre>
baron@kanga:~$ mext -- mysqladmin ext -ri1 -c3
Aborted_clients                               1      0      0
Aborted_connects                              0      0      0
Binlog_cache_disk_use                         0      0      0
Binlog_cache_use                              0      0      0
Bytes_received                             1167     35     35
Bytes_sent                                38926   6337   6337
....
</pre>

<p>This isn&#8217;t an original idea.  Ryan Lowe made a Perl version of this first.  I used his version for a while, but after working on a few machines that didn&#8217;t have the necessary Perl libraries (maybe one of them didn&#8217;t even have Perl, I forget) I decided to do it in shell.</p>

<p>There&#8217;s an added feature.  It&#8217;ll do incremental/differential/relative output for you.  The mysqladmin that ships with MySQL 5.1 has a <a href="http://bugs.mysql.com/bug.php?id=40395">bug that stops it from iterating with -r</a>.  So the script I wrote can accept a -r option, which can then be left off the arguments to mysqladmin:</p>

<pre>
baron@kanga:~$ mext -r -- mysqladmin ext -i1 -c3
</pre>

<p>It&#8217;s kind of a generic tool that you could use with other things besides mysqladmin, but it&#8217;s also kind of tweaked for that purpose. You can <a href="http://www.xaprb.com/mext">get mext here</a>.</p>

<p><strong>Further Reading:</strong><ul><li><a href='http://www.xaprb.com/blog/2009/10/13/using-mext-to-format-saved-mysqladmin-output-nicely/' rel='bookmark' title='Permanent Link: Using mext to format saved mysqladmin output nicely'>Using mext to format saved mysqladmin output nicely</a></li>
<li><a href='http://www.xaprb.com/blog/2009/06/07/extended-covering-indexes/' rel='bookmark' title='Permanent Link: Extended covering indexes'>Extended covering indexes</a></li>
<li><a href='http://www.xaprb.com/blog/2007/06/25/javascript-formatting-library-update/' rel='bookmark' title='Permanent Link: JavaScript formatting library update'>JavaScript formatting library update</a></li>
<li><a href='http://www.xaprb.com/blog/2009/06/05/a-tweak-to-column-alignment-for-the-mext-script/' rel='bookmark' title='Permanent Link: A tweak to column alignment for the mext script'>A tweak to column alignment for the mext script</a></li>
<li><a href='http://www.xaprb.com/blog/2006/08/12/how-to-monitor-mysql-status-and-variables-with-innotop/' rel='bookmark' title='Permanent Link: How to monitor MySQL status and variables with innotop'>How to monitor MySQL status and variables with innotop</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.xaprb.com/blog/2009/04/11/formatting-mysqladmin-extended-status-nicely/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

