summaryrefslogtreecommitdiff
path: root/dev-db/mytop
diff options
context:
space:
mode:
Diffstat (limited to 'dev-db/mytop')
-rw-r--r--dev-db/mytop/Manifest12
-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/files/mytop-1.9.1-global-status.patch94
-rw-r--r--dev-db/mytop/files/mytop-1.9.1-queries-vs-questions-mysql-5.0.76.patch73
-rw-r--r--dev-db/mytop/metadata.xml8
-rw-r--r--dev-db/mytop/mytop-1.6-r4.ebuild36
-rw-r--r--dev-db/mytop/mytop-1.9.1.ebuild35
9 files changed, 447 insertions, 0 deletions
diff --git a/dev-db/mytop/Manifest b/dev-db/mytop/Manifest
new file mode 100644
index 000000000000..9916ece6b76f
--- /dev/null
+++ b/dev-db/mytop/Manifest
@@ -0,0 +1,12 @@
+AUX mytop-1.6-getopt-long-2.38-fixup.patch 578 SHA256 62ccc268d4e04d2476c817e591bcac91c849e08459cf964a4a1724cabbe4fc8a SHA512 a6f6bc9757112acc8cdeeb19e89487ad2ca79524c8d7a577b84c288addc283547837f390a7d7f43317d878e5be796be9d875fd57f548637a3d52aa1cabc5f3a8 WHIRLPOOL 52fd4e99d4e5514922597dc6be7b5c1d7e57b3484dc6f83695dd1ee5a610916314c1a1aa61ce8b0bfb962d8d21d733b3540cd46b4b02e504e594d42e1e5d52e9
+AUX mytop-1.6-global-status.patch 3694 SHA256 ebdbed74ed25213c2be00b86836ba38a45d84e721b60f3f97302fb3b646d1b06 SHA512 bf33682ed457acac751390f757b4b284cf68cae1facdc5d9f3980abae3a3a6580b0558cd114569e79cab2b4ede430fba1c8b426d8b6d500fe0edf833b74d17ab WHIRLPOOL 5d022fc17e2a3c5dbb4b5ff5249030438acad687af9a7df5e3279be9e3f90555567dbda1299274d0b17c926d94c2349ab080a2d479ca7ddee097b7fb481147ac
+AUX mytop-1.6-queries-vs-questions-mysql-5.0.76.patch 3365 SHA256 9ef308336a3cc51721456822d29fb91734e66f75efd3293038b42f0806820297 SHA512 a2735b157b81f702af09d6ee38003e4d15b6f901bc8f5e7013e8c73a1bd9ee798d0ed00ac0578b7e8ef36e5d4ddcc65489325937e9c2074004d2f69fb81fdcfb WHIRLPOOL 5ebe7405ee8bf738900cf8cce1fa61a729fd139965a67aa24101e9de9c67c56627cb64afd13be02e4a701befc09cffe543d0408f832c7f0d2655a2b828b8cdfe
+AUX mytop-1.9.1-global-status.patch 3459 SHA256 744b35b0411e4d1ab93d6725a1c109bd31932d21a4898eb7d8fb401065bbfb50 SHA512 68052535131147a446133fbc155e04e13c5f0195c8fd111059b2bc266aa7a79f72cb25ec1f453e051651783760e212349dc7c50e1de2768d45281d25582a0cc9 WHIRLPOOL e1a0461af27183676a4dbed49866930fcfbe27a3f10d265d7512f7114d2d0478fa146ce84e2af7cf5aee45cb49c1e1e33ef92e0642e05b8578feaba6c2a098bc
+AUX mytop-1.9.1-queries-vs-questions-mysql-5.0.76.patch 3431 SHA256 540b1ba6f2c9214580ba1244827c35690ca36adc933f468633d0f7bfe459fcbb SHA512 50f5373dda953ea7ac18aff65b1319999fe0c53471ebef548309e49e2c6f762d5d98f105280a2c58a324731ff3c1c1af123114acf09f6bb3c99e4580e6041473 WHIRLPOOL 444a802b9043c87c0ef14da46f610700ea9f3cdbbbbff2e8a1f72978a1b8c714b74db28bcf4af085843d10e3fe3505327583a06f5c9219cf456452670d521097
+DIST mytop-1.6.tar.gz 19720 SHA256 b17c702598b10bb0ce2695f609122637c799eaaaec1afaa73246b048f07be9bd SHA512 672209d828c70fd740a791f2e4dfac1e4c594adff197b8bc43322249f03f6c7b18a750da0892c1519fe29e24b661e41d40cdad3a29b546dec4b3a747155566e2 WHIRLPOOL 4fd03d2e871db6b56db2fa7f39046f415a668c3732f47c0668f73ab7109048a8872cfdc01704ba4152d92500f2ab5c5c66b8d2e948748e43ab56e508980c3b08
+DIST mytop-1.9.1.tar.gz 22095 SHA256 179d79459d0013ab9cea2040a41c49a79822162d6e64a7a85f84cdc44828145e SHA512 e6d38812dd69f5e330e5fe9206abe7e00c9e08dd61ba52a9dbd18a823bb09715832d27fb8db6fe1146d78eb56845cc0a7e2a72989ee56267d6482238fee84bc5 WHIRLPOOL 8d47b1067639f1d5464e63abb0ec10df2e98c17112f4ba6321849cea3a0a932e58e04edef83e358ae1cea01f9338509c40bf1e21ef8d46f4820c9f6b89f25b2e
+EBUILD mytop-1.6-r4.ebuild 897 SHA256 0dcee25054e9595e3f1cb5e05bf281547a8397326752e577403b81d6d230a6af SHA512 44c4b20f7dd17a0dd0686ce8250ad54d7d508fe94b41bcacbe5391ff003a37854e0d74e2ebee3cc243e8e94ecc8851a637b9615a3ddffa179173fa02685a7c75 WHIRLPOOL 362a5cce83745b4765ebc2c9bf91d0a1dccf4f65cd316488dea8a2ad89aa76d7b436195692ebf2f094429918a377bdc49355a94e0e50cadc7d6827b6db1b2327
+EBUILD mytop-1.9.1.ebuild 825 SHA256 d2393744d985c2d20f3072fe644f6fe92d95c3a090b2a45840525cdd36ac1cd0 SHA512 26d7b172c52e3056184a48feb381462c1094872aa23168cb3f9cdf9c9b69e4756b1313893c53ad1383438e867ecaa889a0a2fc27c33c9ce868c2cd35baf777e6 WHIRLPOOL 1b22d58ceda81b5740517de774b260c349894ee5e208118a97ec66341041d63aecc2361305b536f7321a8b544281a41cca511c7e2d77845c0a3406b4d814125a
+MISC ChangeLog 2570 SHA256 4d378b854e467027bfb7431a4faabe6d5fa85ad01c57ffb9af263806ed2c39c3 SHA512 ca140317a18625ab0a0803e71e4cfd23875dc90cc2573a3c396a91ae278e172159241530e5d25ef6ca609bbd3b3a4bccd3be57e2853ddd179c7db651260295bd WHIRLPOOL c57fde6c0e9bf244e997e5e995372547b608c9aa4722826964f06b57a3dc840fa658ad7477ee99dea8c5f08cdd357befc329873ddf5ba1b0a77cd5cbb3068926
+MISC ChangeLog-2015 4365 SHA256 734dd535a4200b9da391da460833ab78e62fb28ea40846e7774319e2be369b12 SHA512 60e6b4da4b4b8b771a4194c88e9e0110c22475175b4db0bb3aa1435466dab2e90149105ba20859a81e0e681b785fda420bf3b9ae51a4d63aaa89878aebe68bd9 WHIRLPOOL 74cbd63ac729c735c5ea3217edfeca2379a4502cc9ee63bbb223af7db51d35a510cb571e3c1a7b695a9079a032602b2b42bc3bd7b2b4deddeaa9966210a9d522
+MISC metadata.xml 239 SHA256 a35e1476a1677a91f06dd6e4f955fcebc58c3a07f934b5e62fbf801573a5c82b SHA512 e6e2fafe2f503db1d12e3d2368a99631ee8d014b7ea802d9879e7e3e2c0f9378675fffccd78ed09b914ae781ac3902567b1a53a721906e3ea63ceb51d0a1654b WHIRLPOOL 3ed1945907fa58cbc9997c311d1d0431d481586576ce45b4bc5caf7704ddefe2117305879a97e8021694b86af0d570a34517212b6cc9528224b85e568eee3d75
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/files/mytop-1.9.1-global-status.patch b/dev-db/mytop/files/mytop-1.9.1-global-status.patch
new file mode 100644
index 000000000000..ae0163c31af4
--- /dev/null
+++ b/dev-db/mytop/files/mytop-1.9.1-global-status.patch
@@ -0,0 +1,94 @@
+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.
+
+@@ -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.9.1-queries-vs-questions-mysql-5.0.76.patch b/dev-db/mytop/files/mytop-1.9.1-queries-vs-questions-mysql-5.0.76.patch
new file mode 100644
index 000000000000..0314c8ac82b2
--- /dev/null
+++ b/dev-db/mytop/files/mytop-1.9.1-queries-vs-questions-mysql-5.0.76.patch
@@ -0,0 +1,73 @@
+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);
+
+@@ -924,26 +924,26 @@
+
+
+ printf " Queries: %-6s 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(" Sorts: %5.0f 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{Sort_rows} - $OLD_STATUS{Sort_rows} ) / $t_delta,
+- ( $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..709689b06053
--- /dev/null
+++ b/dev-db/mytop/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+</maintainer>
+</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..306d8d7102e1
--- /dev/null
+++ b/dev-db/mytop/mytop-1.6-r4.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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
+}
diff --git a/dev-db/mytop/mytop-1.9.1.ebuild b/dev-db/mytop/mytop-1.9.1.ebuild
new file mode 100644
index 000000000000..050fb8117112
--- /dev/null
+++ b/dev-db/mytop/mytop-1.9.1.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit perl-module
+
+DESCRIPTION="mytop - a top clone for mysql"
+HOMEPAGE="http://www.mysqlfanboy.com/mytop-3/"
+SRC_URI="http://www.mysqlfanboy.com/mytop-3/${P}.tar.gz"
+
+LICENSE="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.9.1-global-status.patch"
+ "${FILESDIR}/${PN}-1.9.1-queries-vs-questions-mysql-5.0.76.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
+}