Profiling for hook calls.
authordaniel <daniel.kinzler@wikimedia.de>
Thu, 31 Jan 2013 14:39:37 +0000 (15:39 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 1 Feb 2013 10:51:00 +0000 (10:51 +0000)
This is similar to profiloing for db queries.

Change-Id: I14051f8aff30d249f4197270337e4080adfa5417

includes/Hooks.php

index 9e201a2..a29e5fe 100644 (file)
@@ -150,6 +150,7 @@ class Hooks {
                        return true;
                }
 
+               wfProfileIn( 'hook: ' . $event );
                $hooks = self::getHandlers( $event );
 
                foreach ( $hooks as $hook ) {
@@ -288,10 +289,12 @@ class Hooks {
                                        );
                                }
                        } elseif ( !$retval ) {
+                               wfProfileOut( 'hook: ' . $event );
                                return false;
                        }
                }
 
+               wfProfileOut( 'hook: ' . $event );
                return true;
        }