Re-adds I6f807adc9cbf71c5d7b83c7eec43965dce1d2a16 and
Ic04daf475b936b942833362c7a979dde671b3ef4 (reverted in
35ccd9c2fe058ed76be905d9efe06c31c11fd696) with 1:1000 sampling
to avoid swamping the statsd hosts.
Also fixes query module logging.
Bug: T102079
Bug: T106450
Change-Id: I8b9366407c0d1713790d08e69aaa518130f01977
* returning null) is equivalent to returning true.
*/
public static function run( $event, array $args = array(), $deprecatedVersion = null ) {
+ $stats = RequestContext::getMain()->getStats();
+ $metric = $stats->increment( 'hooks.' . $event );
+ $metric->setSampleRate( 0.001 );
+
foreach ( self::getHandlers( $event ) as $hook ) {
// Turn non-array values into an array. (Can't use casting because of objects.)
if ( !is_array( $hook ) ) {
$this->checkAsserts( $params );
+ $stats = $this->getContext()->getStats();
+ $statsPath = 'api.modules.' . strtr( $module->getModulePath(), '+', '.' );
+ $metric = $stats->increment( $statsPath );
+ $metric->setSampleRate( 0.001 );
+
// Execute
$module->execute();
+
Hooks::run( 'APIAfterExecute', array( &$module ) );
$this->reportUnusedParams();
}
$cacheMode = $this->mPageSet->getCacheMode();
+ $stats = $this->getContext()->getStats();
// Execute all unfinished modules
/** @var $module ApiQueryBase */
$params = $module->extractRequestParams();
$cacheMode = $this->mergeCacheMode(
$cacheMode, $module->getCacheMode( $params ) );
+
+ $statsPath = 'api.modules.' . strtr( $module->getModulePath(), '+', '.' );
+ $metric = $stats->increment( $statsPath );
+ $metric->setSampleRate( 0.001 );
+
$module->execute();
Hooks::run( 'APIQueryAfterExecute', array( &$module ) );
}