diff options
author | Yen-Ming Lee <leeym@FreeBSD.org> | 2007-03-30 21:08:53 +0000 |
---|---|---|
committer | Yen-Ming Lee <leeym@FreeBSD.org> | 2007-03-30 21:08:53 +0000 |
commit | 2eb3c07b9e43ca510a100acf620e80a911f6ecb4 (patch) | |
tree | 505c2c3e8bbe397d7b53197a3273a724c4cb436b /databases/mytop | |
parent | a57eb277501baf4d7d53954b7d44e4698da3f1e3 (diff) |
Notes
Diffstat (limited to 'databases/mytop')
-rw-r--r-- | databases/mytop/Makefile | 1 | ||||
-rw-r--r-- | databases/mytop/files/patch-innodb-status | 13 | ||||
-rw-r--r-- | databases/mytop/files/patch-qps-mode | 11 | ||||
-rw-r--r-- | databases/mytop/files/patch-show-slave-status | 45 |
4 files changed, 70 insertions, 0 deletions
diff --git a/databases/mytop/Makefile b/databases/mytop/Makefile index bd1b0ec7e68b..2d7c868bca41 100644 --- a/databases/mytop/Makefile +++ b/databases/mytop/Makefile @@ -7,6 +7,7 @@ PORTNAME= mytop PORTVERSION= 1.6 +PORTREVISION= 1 CATEGORIES= databases MASTER_SITES= http://jeremy.zawodny.com/mysql/mytop/ diff --git a/databases/mytop/files/patch-innodb-status b/databases/mytop/files/patch-innodb-status new file mode 100644 index 000000000000..c6f53242ec5d --- /dev/null +++ b/databases/mytop/files/patch-innodb-status @@ -0,0 +1,13 @@ +--- mytop-1.6.orig 2007-03-30 00:52:47.581910821 +0200 ++++ mytop 2007-03-30 00:52:52.234067036 +0200 +@@ -1099,8 +1099,8 @@ + my @data = Hashes("SHOW INNODB STATUS"); + + open P, "|$config{pager}" or die "$!"; +- print keys %{$data[0]}; +- print $data[0]->{Status},"\n"; ++ print P keys %{$data[0]}; ++ print P $data[0]->{Status},"\n"; + close P; + } + diff --git a/databases/mytop/files/patch-qps-mode b/databases/mytop/files/patch-qps-mode new file mode 100644 index 000000000000..edc5c2abf979 --- /dev/null +++ b/databases/mytop/files/patch-qps-mode @@ -0,0 +1,11 @@ +--- mytop-1.6.orig 2007-03-30 00:52:47.581910821 +0200 ++++ mytop 2007-03-30 00:59:04.174550184 +0200 +@@ -377,7 +377,7 @@ + { + $config{mode} = 'qps'; + Clear() unless $config{batchmode}; +- print "Queries Per Second [hit q to exit this mode]\n"; ++ print "Queries Per Second [hit q to exit, hit t for top mode]\n"; + next; + } + diff --git a/databases/mytop/files/patch-show-slave-status b/databases/mytop/files/patch-show-slave-status new file mode 100644 index 000000000000..834c16c1dd76 --- /dev/null +++ b/databases/mytop/files/patch-show-slave-status @@ -0,0 +1,45 @@ +--- mytop-1.6.orig 2007-03-30 00:52:47.581910821 +0200 ++++ mytop 2007-03-30 02:19:05.114300408 +0200 +@@ -369,6 +369,10 @@ + require Data::Dumper; + print Data::Dumper::Dumper([\%config]); + ReadKey(0); ++ ++ if (-M $0) { # restart application, if it was modified - for debugging ++ exec('perl', $0, @ARGV); ++ } + } + + ## m - mode swtich to qps +@@ -889,8 +893,30 @@ + make_short(($STATUS{Bytes_received} - $OLD_STATUS{Bytes_received}) / $t_delta ), + make_short(($STATUS{Bytes_sent} - $OLD_STATUS{Bytes_sent}) / $t_delta )) + if ($t_delta); +- print "\n\n"; ++ print "\n"; ++ ++ my @slave_status = Hashes("show slave status"); ++ if (@slave_status) ++ { ++ my $line_prefix = " Slave: "; ++ foreach my $s (@slave_status) { ++ print $line_prefix, BOLD(), ++ ($s->{Slave_IO_Running} eq 'Yes' ++ && $s->{Slave_SQL_Running} eq 'Yes' ++ && $s->{Last_Errno} == 0 ++ ? ($s->{Seconds_Behind_Master} > 60 ? BOLD('WARN') : GREEN('OK ')) : RED('ERR ') ++ ), RESET(), ++ " Delay: ", ++ sprintf('%03d:%02d', int($s->{Seconds_Behind_Master} / 60), $s->{Seconds_Behind_Master} % 60), ++ " $s->{Master_User}\@$s->{Master_Host}: ", ++ "$s->{Master_Log_File}/$s->{Read_Master_Log_Pos} ", ++ "\n"; ++ #$line_prefix = ' ' x length($line_prefix); ++ $lines_left--; ++ } ++ } + ++ print "\n"; + $lines_left--; + } + |