We previously had counts for hooks and modules as a side-effect of having them
profiled. We removed the profiling for performance reasons, which left us
without counts also. But the performance of counters is not a concern, and
their signal value not insubstantial. So introduce them here.
Fix getModulePath() to not crash while we're at it.
Change-Id: Ic04daf475b936b942833362c7a979dde671b3ef4
* returning null) is equivalent to returning true.
*/
public static function run( $event, array $args = array(), $deprecatedVersion = null ) {
+ RequestContext::getMain()->getStats()->increment( 'hooks.' . $event );
foreach ( self::getHandlers( $event ) as $hook ) {
// Turn non-array values into an array. (Can't use casting because of objects.)
if ( !is_array( $hook ) ) {
} else {
$this->executeActionWithErrorHandling();
}
+ $this->getContext()->getStats()->increment(
+ 'api.modules.' . strtr( $this->getModule()->getModulePath(), '+', '.' ) );
}
/**