Ignore USE INDEX option.
[lhc/web/wiklou.git] / maintenance / getLagTimes.php
1 <?php
2
3 require 'commandLine.inc';
4
5 if( empty( $wgDBservers ) ) {
6 echo "This script dumps replication lag times, but you don't seem to have\n";
7 echo "a multi-host db server configuration.\n";
8 } else {
9 $lags = $wgLoadBalancer->getLagTimes();
10 foreach( $lags as $n => $lag ) {
11 $host = $wgDBservers[$n]["host"];
12 if( IP::isValid( $host ) ) {
13 $ip = $host;
14 $host = gethostbyaddr( $host );
15 } else {
16 $ip = gethostbyname( $host );
17 }
18 $starLen = min( intval( $lag ), 40 );
19 $stars = str_repeat( '*', $starLen );
20 printf( "%10s %20s %3d %s\n", $ip, $host, $lag, $stars );
21 }
22 }
23
24 ?>