summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-db/mytop
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-db/mytop')
-rw-r--r--dev-db/mytop/Manifest1
-rw-r--r--dev-db/mytop/files/mytop-1.6-getopt-long-2.38-fixup.patch14
-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.patch72
-rw-r--r--dev-db/mytop/metadata.xml5
-rw-r--r--dev-db/mytop/mytop-1.6-r4.ebuild37
6 files changed, 232 insertions, 0 deletions
diff --git a/dev-db/mytop/Manifest b/dev-db/mytop/Manifest
new file mode 100644
index 000000000000..411147ef316a
--- /dev/null
+++ b/dev-db/mytop/Manifest
@@ -0,0 +1 @@
+DIST mytop-1.6.tar.gz 19720 SHA256 b17c702598b10bb0ce2695f609122637c799eaaaec1afaa73246b048f07be9bd SHA512 672209d828c70fd740a791f2e4dfac1e4c594adff197b8bc43322249f03f6c7b18a750da0892c1519fe29e24b661e41d40cdad3a29b546dec4b3a747155566e2 WHIRLPOOL 4fd03d2e871db6b56db2fa7f39046f415a668c3732f47c0668f73ab7109048a8872cfdc01704ba4152d92500f2ab5c5c66b8d2e948748e43ab56e508980c3b08
diff --git a/dev-db/mytop/files/mytop-1.6-getopt-long-2.38-fixup.patch b/dev-db/mytop/files/mytop-1.6-getopt-long-2.38-fixup.patch
new file mode 100644
index 000000000000..b911f9067baa
--- /dev/null
+++ b/dev-db/mytop/files/mytop-1.6-getopt-long-2.38-fixup.patch
@@ -0,0 +1,14 @@
+Getopt-Long-2.38 is stricter about what it allows.
+
+diff -Nuar mytop-1.6.orig/mytop mytop-1.6/mytop
+--- mytop-1.6.orig/mytop 2009-04-10 00:47:31.007111359 -0700
++++ mytop-1.6/mytop 2009-04-10 00:50:39.875391905 -0700
+@@ -153,7 +153,7 @@
+ "idle|i" => \$config{idle},
+ "resolve|r" => \$config{resolve},
+ "prompt!" => \$config{prompt},
+- "long|!" => \$config{long_nums},
++ "long!" => \$config{long_nums},
+ "mode|m=s" => \$config{mode},
+ "sort=s" => \$config{sort},
+ );
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..f1e139fe7471
--- /dev/null
+++ b/dev-db/mytop/files/mytop-1.6-queries-vs-questions-mysql-5.0.76.patch
@@ -0,0 +1,72 @@
+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
+
+====
+Revision 2:
+The first revision missed changing the instances of $OLD_STATUS{Questions}.
+
+diff -Nuar mytop-1.6.orig/mytop mytop-1.6/mytop
+--- mytop-1.6.orig/mytop 2009-02-14 17:28:38.696187159 -0800
++++ mytop-1.6/mytop 2009-02-14 17:36:31.192890507 -0800
+@@ -800,8 +800,15 @@
+
+ ## Queries per second...
+
+- my $avg_queries_per_sec = sprintf("%.2f", $STATUS{Questions} / $STATUS{Uptime});
+- my $num_queries = $STATUS{Questions};
++ my ($num_queries, $old_num_queries);
++ if(defined($STATUS{Queries})) {
++ $num_queries = $STATUS{Queries};
++ $old_num_queries = $OLD_STATUS{Queries};
++ } else {
++ $num_queries = $STATUS{Questions};
++ $old_num_queries = $OLD_STATUS{Questions};
++ }
++ my $avg_queries_per_sec = sprintf("%.2f", $num_queries / $STATUS{Uptime});
+
+ my @t = localtime(time);
+
+@@ -820,25 +827,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_num_queries );
++# print("q_diff: $num_queries - $old_num_queries / $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_num_queries ) / $t_delta,
+ ( # slow now (qps)
+ ($STATUS{Slow_queries} ) ?
+ ( $STATUS{Slow_queries} - $OLD_STATUS{Slow_queries} ) / $t_delta :
diff --git a/dev-db/mytop/metadata.xml b/dev-db/mytop/metadata.xml
new file mode 100644
index 000000000000..716e7d4301bd
--- /dev/null
+++ b/dev-db/mytop/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>mysql</herd>
+</pkgmetadata>
diff --git a/dev-db/mytop/mytop-1.6-r4.ebuild b/dev-db/mytop/mytop-1.6-r4.ebuild
new file mode 100644
index 000000000000..b0230f1a8f80
--- /dev/null
+++ b/dev-db/mytop/mytop-1.6-r4.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit perl-module
+
+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=""
+
+RDEPEND="dev-perl/DBD-mysql
+ virtual/perl-Getopt-Long
+ dev-perl/TermReadKey
+ virtual/perl-Term-ANSIColor
+ virtual/perl-Time-HiRes"
+DEPEND="${RDEPEND}
+ >=sys-apps/sed-4"
+
+PATCHES=( "${FILESDIR}/${PN}-1.6-global-status.patch"
+ "${FILESDIR}/${PN}-1.6-queries-vs-questions-mysql-5.0.76.patch"
+ "${FILESDIR}/${PN}-1.6-getopt-long-2.38-fixup.patch"
+ )
+SRC_TEST="do"
+
+src_install() {
+ perl-module_src_install
+ sed -i -r\
+ -e "s|socket( +)=> '',|socket\1=> '/var/run/mysqld/mysqld.sock',|g" \
+ "${D}"/usr/bin/mytop
+}