X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FHooks.php;h=c726538c9932ce6cb7cd14cdc01b1ad10bcbfc1b;hb=31ba08675466eb1dae5cad7294b527f135c6226d;hp=036d65c71e60943c4e2f5bfbf797305e180ad066;hpb=012248fc5a7d6d0257df1a0feadbda5ae4a477e2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Hooks.php b/includes/Hooks.php index 036d65c71e..c726538c99 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -135,6 +135,10 @@ class Hooks { * 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 ) ) {