* backlinks, embeddedin and imageusage lists should use (bl|ei|iu)title parameter
instead of titles. Titles for these lists is obsolete and might stop working soon.
* Added prop=imageinfo - gets image properties and upload history
+* (bug 10211) Added db server replication lag information in meta=siteinfo
== Maintenance script changes since 1.10 ==
$filteriw = isset($params['filteriw']) ? $params['filteriw'] : false;
$this->appendInterwikiMap($p, $filteriw);
break;
+ case 'dbserverlag' :
+ $this->appendDbServerLagInfo($p, $params['showalldb']);
+ break;
}
}
}
$this->getResult()->setIndexedTagName($data, 'iw');
$this->getResult()->addValue('query', $property, $data);
}
+
+ protected function appendDbServerLagInfo($property, $includeAll) {
+ global $wgLoadBalancer;
+
+ $data = array();
+
+ if ($includeAll) {
+ global $wgDBservers;
+ $lags = $wgLoadBalancer->getLagTimes();
+ foreach( $lags as $i => $lag ) {
+ $data[] = array (
+ 'host' => $wgDBservers[$i]['host'],
+ 'lag' => $lag);
+ }
+ } else {
+ list( $host, $lag ) = $wgLoadBalancer->getMaxLag();
+ $data[] = array (
+ 'host' => $host,
+ 'lag' => $lag);
+ }
+
+ $result = $this->getResult();
+ $result->setIndexedTagName($data, 'db');
+ $result->addValue('query', $property, $data);
+ }
protected function getAllowedParams() {
return array (
ApiBase :: PARAM_TYPE => array (
'general',
'namespaces',
- 'interwikimap'
+ 'interwikimap',
+ 'dbserverlag',
)),
'filteriw' => array (
'local',
'!local',
)),
+
+ 'showalldb' => false,
);
}
'Which sysinfo properties to get:',
' "general" - Overall system information',
' "namespaces" - List of registered namespaces (localized)',
- ' "interwikimap" - Return interwiki map (optionally filtered)'
+ ' "interwikimap" - Return interwiki map (optionally filtered)',
+ ' "dbserverlag" - Get highest database replication server lag',
),
'filteriw' => 'Return only local or only nonlocal entries of the interwiki map',
+ 'showalldb' => 'List all DB servers, not just the one lagging the most',
);
}