From d1f1f9d98d47d1483be6ce92b20d177e9dd59b16 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 18 Nov 2014 11:51:49 -0800 Subject: [PATCH] ProfilerOutput: Remove logStandardData() and make log() abstract Became unused layer of abtraction as I266ed820 went through iterations Change-Id: Ic739fb4519bb2e23e679828b191c11c0158ade78 --- includes/profiler/Profiler.php | 2 +- includes/profiler/output/ProfilerOutput.php | 9 +-------- includes/profiler/output/ProfilerOutputDb.php | 2 +- includes/profiler/output/ProfilerOutputText.php | 2 +- includes/profiler/output/ProfilerOutputUdp.php | 2 +- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/includes/profiler/Profiler.php b/includes/profiler/Profiler.php index 12e999b8da..cd20311eee 100644 --- a/includes/profiler/Profiler.php +++ b/includes/profiler/Profiler.php @@ -150,7 +150,7 @@ abstract class Profiler { $class = 'ProfilerOutput' . ucfirst( strtolower( $outType ) ); $profileOut = new $class( $this, $this->params ); if ( $profileOut->canUse() ) { - $profileOut->log(); + $profileOut->log( $this->getFunctionStats() ); } } } diff --git a/includes/profiler/output/ProfilerOutput.php b/includes/profiler/output/ProfilerOutput.php index e8e0085155..3473e0b20b 100644 --- a/includes/profiler/output/ProfilerOutput.php +++ b/includes/profiler/output/ProfilerOutput.php @@ -48,17 +48,10 @@ abstract class ProfilerOutput { return true; } - /** - * Delegate to the proper method - */ - public function log() { - $this->logStandardData( $this->collector->getFunctionStats() ); - } - /** * Log MediaWiki-style profiling data * * @param array $stats Result of Profiler::getFunctionStats() */ - abstract protected function logStandardData( array $stats ); + abstract public function log( array $stats ); } diff --git a/includes/profiler/output/ProfilerOutputDb.php b/includes/profiler/output/ProfilerOutputDb.php index 3c2912eef4..e3cfd3148c 100644 --- a/includes/profiler/output/ProfilerOutputDb.php +++ b/includes/profiler/output/ProfilerOutputDb.php @@ -35,7 +35,7 @@ class ProfilerOutputDb extends ProfilerOutput { return !wfReadOnly(); } - protected function logStandardData( array $stats ) { + public function log( array $stats ) { global $wgProfilePerHost; if ( $wgProfilePerHost ) { diff --git a/includes/profiler/output/ProfilerOutputText.php b/includes/profiler/output/ProfilerOutputText.php index 1fa74952ee..62c8088289 100644 --- a/includes/profiler/output/ProfilerOutputText.php +++ b/includes/profiler/output/ProfilerOutputText.php @@ -42,7 +42,7 @@ class ProfilerOutputText extends ProfilerOutput { ? $params['thresholdMs'] : .25; } - protected function logStandardData( array $stats ) { + public function log( array $stats ) { if ( $this->collector->getTemplated() ) { $out = ''; diff --git a/includes/profiler/output/ProfilerOutputUdp.php b/includes/profiler/output/ProfilerOutputUdp.php index c16ece2d11..a938861f79 100644 --- a/includes/profiler/output/ProfilerOutputUdp.php +++ b/includes/profiler/output/ProfilerOutputUdp.php @@ -34,7 +34,7 @@ class ProfilerOutputUdp extends ProfilerOutput { return function_exists( 'socket_create' ); } - protected function logStandardData( array $stats ) { + public function log( array $stats ) { global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgUDPProfilerFormatString; $sock = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP ); -- 2.20.1