* 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 ) );
}