From a556484ba0f5ef4dc9f1b9996d2462bbffc497e5 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 21 Aug 2015 19:35:48 +0000 Subject: [PATCH] Revert "Count API and hook calls, with 1:1000 sampling" This seems to use 3.67% of index.php real time per xenon. This reverts commit c4cd2399390f7922c88bb521c39bfbefe000338e. Change-Id: I1eb8dfc72036493e430271f0db3f2f2f96b149c3 --- includes/Hooks.php | 4 ---- includes/api/ApiMain.php | 6 ------ includes/api/ApiQuery.php | 6 ------ 3 files changed, 16 deletions(-) diff --git a/includes/Hooks.php b/includes/Hooks.php index c726538c99..036d65c71e 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -135,10 +135,6 @@ 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 ) ) { diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 8ce505a0d7..f2059d759e 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -1089,14 +1089,8 @@ 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 $module->execute(); - Hooks::run( 'APIAfterExecute', array( &$module ) ); $this->reportUnusedParams(); diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index 8959a46820..5378e9259f 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -276,7 +276,6 @@ class ApiQuery extends ApiBase { } $cacheMode = $this->mPageSet->getCacheMode(); - $stats = $this->getContext()->getStats(); // Execute all unfinished modules /** @var $module ApiQueryBase */ @@ -284,11 +283,6 @@ 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 ) ); } -- 2.20.1