Merge "API: Use message-per-value for apihelp-query+alllinks-param-prop"
[lhc/web/wiklou.git] / includes / api / ApiQuery.php
index 5378e92..8959a46 100644 (file)
@@ -276,6 +276,7 @@ class ApiQuery extends ApiBase {
                }
 
                $cacheMode = $this->mPageSet->getCacheMode();
+               $stats =  $this->getContext()->getStats();
 
                // Execute all unfinished modules
                /** @var $module ApiQueryBase */
@@ -283,6 +284,11 @@ class ApiQuery extends ApiBase {
                        $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 ) );
                }