3 require 'commandLine.inc';
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";
9 $lags = $wgLoadBalancer->getLagTimes();
10 foreach( $lags as $n => $lag ) {
11 $host = $wgDBservers[$n]["host"];
12 if( IP
::isValid( $host ) ) {
14 $host = gethostbyaddr( $host );
16 $ip = gethostbyname( $host );
18 $starLen = min( intval( $lag ), 40 );
19 $stars = str_repeat( '*', $starLen );
20 printf( "%10s %20s %3d %s\n", $ip, $host, $lag, $stars );