Merge "API: Use message-per-value for apihelp-query+usercontribs-param-prop"
[lhc/web/wiklou.git] / includes / api / ApiMain.php
index 46dc7df..8ce505a 100644 (file)
@@ -1089,10 +1089,14 @@ class ApiMain extends ApiBase {
 
                $this->checkAsserts( $params );
 
+               $stats = $this->getContext()->getStats();
+               $statsPath = 'api.modules.' . strtr( $module->getModulePath(), '+', '.' );
+               $metric = $stats->increment( $statsPath );
+               $metric->setSampleRate( 0.001 );
+
                // Execute
-               $this->getContext()->getStats()->increment(
-                       'api.modules.' . strtr( $module->getModulePath(), '+', '.' ) );
                $module->execute();
+
                Hooks::run( 'APIAfterExecute', array( &$module ) );
 
                $this->reportUnusedParams();