summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2009-02-13 22:09:38 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2009-02-13 22:09:38 +0000
commit15d8c0bdecbdda7a5344c00c168a28445207aafd (patch)
treed0298d3b46e985a68b619d5fbddab8540d56d389 /dev-db/mytop
parentviking bump (diff)
downloadhistorical-15d8c0bdecbdda7a5344c00c168a28445207aafd.tar.gz
historical-15d8c0bdecbdda7a5344c00c168a28445207aafd.tar.bz2
historical-15d8c0bdecbdda7a5344c00c168a28445207aafd.zip
Deal with the fallout from upstream MySQL bug 41131 so that statistics displays are still correct in mytop.
Package-Manager: portage-2.2_rc23/cvs/Linux x86_64
Diffstat (limited to 'dev-db/mytop')
-rw-r--r--dev-db/mytop/ChangeLog13
-rw-r--r--dev-db/mytop/Manifest15
-rw-r--r--dev-db/mytop/files/mytop-1.6-global-status.patch103
-rw-r--r--dev-db/mytop/files/mytop-1.6-queries-vs-questions-mysql-5.0.76.patch61
-rw-r--r--dev-db/mytop/mytop-1.6-r1.ebuild31
5 files changed, 210 insertions, 13 deletions
diff --git a/dev-db/mytop/ChangeLog b/dev-db/mytop/ChangeLog
index 47a9f7d17a7e..be7eebeef3da 100644
--- a/dev-db/mytop/ChangeLog
+++ b/dev-db/mytop/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for dev-db/mytop
-# Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/mytop/ChangeLog,v 1.18 2008/11/18 16:01:44 tove Exp $
+# Copyright 2000-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mytop/ChangeLog,v 1.19 2009/02/13 22:09:38 robbat2 Exp $
+
+*mytop-1.6-r1 (13 Feb 2009)
+
+ 13 Feb 2009; Robin H. Johnson <robbat2@gentoo.org>
+ +files/mytop-1.6-global-status.patch,
+ +files/mytop-1.6-queries-vs-questions-mysql-5.0.76.patch,
+ +mytop-1.6-r1.ebuild:
+ Deal with the fallout from upstream MySQL bug 41131 so that statistics
+ displays are still correct in mytop.
18 Nov 2008; Torsten Veller <tove@gentoo.org> mytop-1.4.ebuild,
mytop-1.6.ebuild:
diff --git a/dev-db/mytop/Manifest b/dev-db/mytop/Manifest
index f7e28815f175..957b21e3523a 100644
--- a/dev-db/mytop/Manifest
+++ b/dev-db/mytop/Manifest
@@ -1,16 +1,9 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
+AUX mytop-1.6-global-status.patch 3694 RMD160 ce80216e38fd4f877ca2d3d0ad9505359fbc1f4a SHA1 75994e7a85f1ec617fea7212760019b84ae92aee SHA256 ebdbed74ed25213c2be00b86836ba38a45d84e721b60f3f97302fb3b646d1b06
+AUX mytop-1.6-queries-vs-questions-mysql-5.0.76.patch 3056 RMD160 c45bdf0885ce234db90d69e979e0923467899fa6 SHA1 883d05dbb3bd131749ee4fc852b8eaedadc1ddb2 SHA256 31618f03b1eb2d8deaacdc44835bd460faaf4815e654a13e5a82f05e855b80c7
DIST mytop-1.4.tar.gz 18723 RMD160 727f28da3ee440bcec2d950370a16af92e46c105 SHA1 a4629403a3c73287d43d1fb2ed0a3362fccb2e43 SHA256 0ac19a2cd16b4a25d0741c1cee9b056557aea18bb617edd9329a0b78927049dc
DIST mytop-1.6.tar.gz 19720 RMD160 d2ff40b75c33d09d7cd14602fc78952ca52f8dab SHA1 e1485115ca3a15e79f7811bdc1cfe692aa95833f SHA256 b17c702598b10bb0ce2695f609122637c799eaaaec1afaa73246b048f07be9bd
EBUILD mytop-1.4.ebuild 770 RMD160 d9d2c96f1c23dce2d2198ed268ffedb273d24425 SHA1 3c4d3334f54d90f97ef2661ed1b98f5eb5c37cab SHA256 1d30811b62f53b6f0233ea05506d12c5b590bdfc4326695a6084e4849c1f724f
+EBUILD mytop-1.6-r1.ebuild 888 RMD160 2e958d08f9f594e7bcf53d2649243e170d0662b9 SHA1 3e56a99186f7d923737d38229a294bf382410a32 SHA256 4b3823a054656d86ce077d12c64283f95f700b29f4f79ec526ed3e8c9a003857
EBUILD mytop-1.6.ebuild 769 RMD160 6b1fcb49c51d4a24a5b74271173f6da41cdf7247 SHA1 c4e5df25461b3feb919edaad60bd8293cdf79ffb SHA256 58cbb9875e1a1a7923583d10d2e62a17f41bf3ee34f60f3b6044d08ce0a86357
-MISC ChangeLog 2111 RMD160 675a1dc44c8121841be02532bc6c2769f5280a54 SHA1 200c43eeba57a8969514f2070b422caba9cae411 SHA256 54b509f7dbf5bf12bf00183f3241120776151a4ae645232f3086ea5858b6c1c2
+MISC ChangeLog 2433 RMD160 63621d5bc0157fce3a3c31abf32df56c704bed3e SHA1 2fe97711c4b1b923b2210ee4f9bc641f671e1f26 SHA256 22965722e169619f778ce02873a71e47211201111a5d8b278b923cbc73a4a008
MISC metadata.xml 158 RMD160 17ad87fdb088c4a22ea1849e25da6efdddf26aa5 SHA1 e5826687b0a91fba71e62888faa74fe37f44045a SHA256 a212959a64142f5508788a3d336b55cdb97645b6e54d8a887e7308c67791d569
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.9 (GNU/Linux)
-
-iEUEARECAAYFAkki5tkACgkQV3J2n04Eauz7fQCYkQfYTc+ScMA1PmIPR2swiVrD
-owCg1aGKc6l3SMmWovLwcgtLw3Gz6SA=
-=Ccug
------END PGP SIGNATURE-----
diff --git a/dev-db/mytop/files/mytop-1.6-global-status.patch b/dev-db/mytop/files/mytop-1.6-global-status.patch
new file mode 100644
index 000000000000..ae75ac7867af
--- /dev/null
+++ b/dev-db/mytop/files/mytop-1.6-global-status.patch
@@ -0,0 +1,103 @@
+Use GLOBAL STATUS instead of implicit session status.
+
+As of MySQL-5.0.72, many of the status variables split for session and global
+variants. Importantly, the Com_* and Questions ones did, and this broke the
+statistics at the top of mytop.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+MySQL-Bug: 41131
+MySQL-Bug-URL: http://bugs.mysql.com/bug.php?id=41131
+
+diff -Nuar --exclude '*~' mytop-1.6.orig/mytop mytop-1.6/mytop
+--- mytop-1.6.orig/mytop 2007-02-16 20:57:46.000000000 -0800
++++ mytop-1.6/mytop 2008-11-30 15:18:05.818845253 -0800
+@@ -98,7 +98,7 @@
+ my %qcache = (); ## The query cache--used for full query info support.
+ my %ucache = (); ## The user cache--used for full killing by user
+ my %dbcache = (); ## The db cache. This should be merged at some point.
+-my %statcache = (); ## The show status cache for GetShowStatus()
++my %statcache = (); ## The show global status cache for GetShowStatus()
+
+ my (%STATUS, %OLD_STATUS); # header stuff.
+
+@@ -710,7 +710,7 @@
+ ##
+ if ($config{header})
+ {
+- my @recs = Hashes("show status");
++ my @recs = Hashes("show global status");
+
+ ## if the server died or we lost connectivity
+ if (not @recs)
+@@ -755,7 +755,7 @@
+
+ ## Query Cache info
+ ##
+- ## mysql> show status like 'qcache%';
++ ## mysql> show global status like 'qcache%';
+ ## +-------------------------+----------+
+ ## | Variable_name | Value |
+ ## +-------------------------+----------+
+@@ -1064,7 +1064,7 @@
+
+ sub GetQPS()
+ {
+- my($data) = Hashes('SHOW STATUS LIKE "Questions"');
++ my($data) = Hashes('SHOW GLOBAL STATUS LIKE "Questions"');
+ my $num = $data->{Value};
+
+ if (not defined $questions) ## first time?
+@@ -1126,7 +1126,7 @@
+ }
+
+ # Variable_name and Value pairs come back...
+- my @data = Hashes("SHOW STATUS LIKE 'Com_%'");
++ my @data = Hashes("SHOW GLOBAL STATUS LIKE 'Com_%'");
+ my %cmd_data;
+ my %cmd_delta;
+ my %cmd_pct;
+@@ -1216,7 +1216,7 @@
+ sub GetShowStatus()
+ {
+ Clear() unless $config{batchmode};
+- my @rows = Hashes("SHOW STATUS");
++ my @rows = Hashes("SHOW GLOBAL STATUS");
+
+ printf "%32s %10s %10s\n", 'Counter', 'Total', 'Change';
+ printf "%32s %10s %10s\n", '-------', '-----', '------';
+@@ -1543,7 +1543,7 @@
+
+ And you obviously need access to a MySQL server (version 3.22.x or
+ 3.23.x) with the necessary security to run the I<SHOW PROCESSLIST> and
+-I<SHOW STATUS> commands.
++I<SHOW GLOBAL STATUS> commands.
+
+ If you are a Windows user, using ActiveState's Perl, you can use PPM
+ (the Perl Package Manager) to install the MySQL and Term::ReadKey
+@@ -1599,7 +1599,7 @@
+ notice features from each of them here.
+
+ B<mytop> will connect to a MySQL server and periodically run the
+-I<SHOW PROCESSLIST> and I<SHOW STATUS> commands and attempt to
++I<SHOW PROCESSLIST> and I<SHOW GLOBAL STATUS> commands and attempt to
+ summarize the information from them in a useful format.
+
+ =head2 The Display
+@@ -1817,7 +1817,7 @@
+
+ =item B<c>
+
+-Show "command counters" based on the Com_* values in SHOW STATUS.
++Show "command counters" based on the Com_* values in SHOW GLOBAL STATUS.
+ This is a new feature. Feedback welcome.
+
+ =item B<d>
+@@ -1904,7 +1904,7 @@
+
+ Some performance information is not available when talking to a
+ version 3.22.x MySQL server. Additional information (about threads
+-mostly) was added to the output of I<SHOW STATUS> in MySQL 3.23.x and
++mostly) was added to the output of I<SHOW GLOBAL STATUS> in MySQL 3.23.x and
+ B<mytop> makes use of it. If the information is not available, you
+ will simply see zeros where the real numbers should be.
+
diff --git a/dev-db/mytop/files/mytop-1.6-queries-vs-questions-mysql-5.0.76.patch b/dev-db/mytop/files/mytop-1.6-queries-vs-questions-mysql-5.0.76.patch
new file mode 100644
index 000000000000..85e33fccd952
--- /dev/null
+++ b/dev-db/mytop/files/mytop-1.6-queries-vs-questions-mysql-5.0.76.patch
@@ -0,0 +1,61 @@
+In MySQL 5.0.72 the Questions variable was changed to only contain the number
+of client-initiated queries, NOT the number of overall queries. This caused
+problems with the select/insert/update/delete percentages because Com_* was
+still based on the overall queries.
+
+MySQL 5.0.76 introduced a new variable 'Queries' with the behavior of the old
+Questions variable.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+MySQL-Bug: 41131
+MySQL-Bug-URL: http://bugs.mysql.com/?id=41131
+
+diff -Nuar mytop-1.6.orig/mytop mytop-1.6/mytop
+--- mytop-1.6.orig/mytop 2009-02-13 13:59:43.882787823 -0800
++++ mytop-1.6/mytop 2009-02-13 14:03:54.749418810 -0800
+@@ -800,8 +800,8 @@
+
+ ## Queries per second...
+
+- my $avg_queries_per_sec = sprintf("%.2f", $STATUS{Questions} / $STATUS{Uptime});
+- my $num_queries = $STATUS{Questions};
++ my $num_queries = defined($STATUS{Queries}) ? $STATUS{Queries} : $STATUS{Questions};
++ my $avg_queries_per_sec = sprintf("%.2f", $num_queries / $STATUS{Uptime});
+
+ my @t = localtime(time);
+
+@@ -820,25 +820,25 @@
+
+
+ printf " Queries: %-5s qps: %4.0f Slow: %7s Se/In/Up/De(%%): %02.0f/%02.0f/%02.0f/%02.0f \n",
+- make_short( $STATUS{Questions} ), # q total
+- $STATUS{Questions} / $STATUS{Uptime}, # qps, average
++ make_short( $num_queries ), # q total
++ $num_queries / $STATUS{Uptime}, # qps, average
+ make_short( $STATUS{Slow_queries} ), # slow
+
+ # hmm. a Qcache hit is really a select and should be counted.
+- 100 * ($STATUS{Com_select} + ($STATUS{Qcache_hits}||0) ) / $STATUS{Questions},
+- 100 * ($STATUS{Com_insert} + $STATUS{Com_replace} ) / $STATUS{Questions},
+- 100 * ($STATUS{Com_update} ) / $STATUS{Questions},
+- 100 * $STATUS{Com_delete} / $STATUS{Questions};
++ 100 * ($STATUS{Com_select} + ($STATUS{Qcache_hits}||0) ) / $num_queries,
++ 100 * ($STATUS{Com_insert} + $STATUS{Com_replace} ) / $num_queries,
++ 100 * ($STATUS{Com_update} ) / $num_queries,
++ 100 * $STATUS{Com_delete} / $num_queries;
+
+ $lines_left--;
+
+ if ($t_delta)
+ {
+- my $q_diff = ( $STATUS{Questions} - $OLD_STATUS{Questions} );
+-# print("q_diff: $STATUS{Questions} - $OLD_STATUS{Questions} / $t_delta = $q_diff\n");
++ my $q_diff = ( $num_queries - $OLD_STATUS{Questions} );
++# print("q_diff: $num_queries - $OLD_STATUS{Questions} / $t_delta = $q_diff\n");
+
+ printf(" qps now: %4.0f Slow qps: %3.1f Threads: %4.0f (%4.0f/%4.0f) %02.0f/%02.0f/%02.0f/%02.0f \n",
+- ( $STATUS{Questions} - $OLD_STATUS{Questions} ) / $t_delta,
++ ( $num_queries - $OLD_STATUS{Questions} ) / $t_delta,
+ ( # slow now (qps)
+ ($STATUS{Slow_queries} ) ?
+ ( $STATUS{Slow_queries} - $OLD_STATUS{Slow_queries} ) / $t_delta :
diff --git a/dev-db/mytop/mytop-1.6-r1.ebuild b/dev-db/mytop/mytop-1.6-r1.ebuild
new file mode 100644
index 000000000000..8ccb7f4a695b
--- /dev/null
+++ b/dev-db/mytop/mytop-1.6-r1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mytop/mytop-1.6-r1.ebuild,v 1.1 2009/02/13 22:09:38 robbat2 Exp $
+
+inherit perl-app
+
+DESCRIPTION="mytop - a top clone for mysql"
+HOMEPAGE="http://jeremy.zawodny.com/mysql/mytop/"
+SRC_URI="http://jeremy.zawodny.com/mysql/mytop/${P}.tar.gz"
+
+LICENSE="|| ( Artistic GPL-2 )"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
+SLOT="0"
+IUSE=""
+
+DEPEND="dev-perl/DBD-mysql
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes
+ >=sys-apps/sed-4"
+
+PATCHES="${FILESDIR}/${P}-global-status.patch
+ ${FILESDIR}/${P}-queries-vs-questions-mysql-5.0.76.patch"
+
+src_install() {
+ perl-module_src_install
+ sed -i -r\
+ -e "s|socket( +)=> '',|socket\1=> '/var/run/mysqld/mysqld.sock',|g" \
+ "${D}"/usr/bin/mytop
+}