summaryrefslogtreecommitdiff
path: root/maintenance/getLagTimes.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2007-01-11 19:06:07 +0000
committerPierre Schmitz <pierre@archlinux.de>2007-01-11 19:06:07 +0000
commita58285fd06c8113c45377c655dd43cef6337e815 (patch)
treedfe31d3d12652352fe44890b4811eda0728faefb /maintenance/getLagTimes.php
parent20194986f6638233732ba1fc3e838f117d3cc9ea (diff)
Aktualisierung auf MediaWiki 1.9.0
Diffstat (limited to 'maintenance/getLagTimes.php')
-rw-r--r--maintenance/getLagTimes.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/maintenance/getLagTimes.php b/maintenance/getLagTimes.php
new file mode 100644
index 00000000..f2c06f6a
--- /dev/null
+++ b/maintenance/getLagTimes.php
@@ -0,0 +1,23 @@
+<?php
+
+require 'commandLine.inc';
+
+if( empty( $wgDBservers ) ) {
+ echo "This script dumps replication lag times, but you don't seem to have\n";
+ echo "a multi-host db server configuration.\n";
+} else {
+ $lags = $wgLoadBalancer->getLagTimes();
+ foreach( $lags as $n => $lag ) {
+ $host = $wgDBservers[$n]["host"];
+ if( IP::isValid( $host ) ) {
+ $ip = $host;
+ $host = gethostbyaddr( $host );
+ } else {
+ $ip = gethostbyname( $host );
+ }
+ $stars = str_repeat( '*', intval( $lag ) );
+ printf( "%10s %20s %3d %s\n", $ip, $host, $lag, $stars );
+ }
+}
+
+?> \ No newline at end of file