Commit c362ea3f authored by fran's avatar fran Committed by Sergei Golubchik

Added Master_Host to the Replication information

Closes #3
parent 1956695c
...@@ -438,7 +438,7 @@ while (1) ...@@ -438,7 +438,7 @@ while (1)
if ($key eq 'C') if ($key eq 'C')
{ {
if ( $HAS_COLOR ) if ( $HAS_COLOR )
{ {
$HAS_COLOR = 0; $HAS_COLOR = 0;
} }
...@@ -818,11 +818,11 @@ sub GetData() ...@@ -818,11 +818,11 @@ sub GetData()
if ($config{header}) if ($config{header})
{ {
my @recs = ""; my @recs = "";
if ( $db_release > 4 ) if ( $db_release > 4 )
{ {
@recs = Hashes("show global status"); @recs = Hashes("show global status");
} }
else else
{ {
@recs = Hashes("show status"); @recs = Hashes("show status");
} }
...@@ -979,7 +979,7 @@ sub GetData() ...@@ -979,7 +979,7 @@ sub GetData()
# print("q_diff: $STATUS{Questions} - $OLD_STATUS{Questions} / $t_delta = $q_diff\n"); # print("q_diff: $STATUS{Questions} - $OLD_STATUS{Questions} / $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", 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{Sort_rows} - $OLD_STATUS{Sort_rows} ) / $t_delta,
( $STATUS{Questions} - $OLD_STATUS{Questions} ) / $t_delta, ( $STATUS{Questions} - $OLD_STATUS{Questions} ) / $t_delta,
( # slow now (qps) ( # slow now (qps)
($STATUS{Slow_queries} ) ? ($STATUS{Slow_queries} ) ?
...@@ -990,7 +990,7 @@ sub GetData() ...@@ -990,7 +990,7 @@ sub GetData()
$STATUS{Threads_running}, $STATUS{Threads_running},
$STATUS{Threads_cached}, $STATUS{Threads_cached},
(100 * ($STATUS{Com_select} - $OLD_STATUS{Com_select} + (100 * ($STATUS{Com_select} - $OLD_STATUS{Com_select} +
($STATUS{Qcache_hits}||0) - ($OLD_STATUS{Qcache_hits}||0) ($STATUS{Qcache_hits}||0) - ($OLD_STATUS{Qcache_hits}||0)
) ) / ($q_diff ), ) ) / ($q_diff ),
(100 * ($STATUS{Com_insert} - $OLD_STATUS{Com_insert} + (100 * ($STATUS{Com_insert} - $OLD_STATUS{Com_insert} +
...@@ -1076,7 +1076,7 @@ sub GetData() ...@@ -1076,7 +1076,7 @@ sub GetData()
$t_delta, $t_delta,
($STATUS{Rows_tmp_read} - $OLD_STATUS{Rows_tmp_read}) / ($STATUS{Rows_tmp_read} - $OLD_STATUS{Rows_tmp_read}) /
$t_delta, $t_delta,
($STATUS{Handler_tmp_write} ($STATUS{Handler_tmp_write}
-$OLD_STATUS{Handler_tmp_write})/$t_delta, -$OLD_STATUS{Handler_tmp_write})/$t_delta,
($STATUS{Handler_tmp_update} - ($STATUS{Handler_tmp_update} -
$OLD_STATUS{Handler_tmp_update})/$t_delta); $OLD_STATUS{Handler_tmp_update})/$t_delta);
...@@ -1120,6 +1120,7 @@ sub GetData() ...@@ -1120,6 +1120,7 @@ sub GetData()
} }
} }
print " Replication "; print " Replication ";
print "Master:$data->{Master_Host} ";
print "IO:$data->{Slave_IO_Running} "; print "IO:$data->{Slave_IO_Running} ";
print "SQL:$data->{Slave_SQL_Running} "; print "SQL:$data->{Slave_SQL_Running} ";
print RESET() if ($HAS_COLOR); print RESET() if ($HAS_COLOR);
...@@ -1226,9 +1227,9 @@ sub GetData() ...@@ -1226,9 +1227,9 @@ sub GetData()
$thread->{State} ||= ""; $thread->{State} ||= "";
$thread->{Progress} ||= 0; $thread->{Progress} ||= 0;
## alter double hyphen comments so they don't break ## alter double hyphen comments so they don't break
## the query when newlines are removed - http://freshmeat.net/users/jerjones ## the query when newlines are removed - http://freshmeat.net/users/jerjones
$thread->{Info} =~ s~\s--(.*)$~ /* $1 */ ~mg; $thread->{Info} =~ s~\s--(.*)$~ /* $1 */ ~mg;
## Normalize spaces -- mostly disabled for now. This can ## Normalize spaces -- mostly disabled for now. This can
## break EXPLAIN if you try to explain a mangled query. It ## break EXPLAIN if you try to explain a mangled query. It
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment