ProfilerOutput: Remove logStandardData() and make log() abstract
authorChad Horohoe <chadh@wikimedia.org>
Tue, 18 Nov 2014 19:51:49 +0000 (11:51 -0800)
committerChad Horohoe <chadh@wikimedia.org>
Tue, 18 Nov 2014 19:51:49 +0000 (11:51 -0800)
Became unused layer of abtraction as I266ed820 went through iterations

Change-Id: Ic739fb4519bb2e23e679828b191c11c0158ade78

includes/profiler/Profiler.php
includes/profiler/output/ProfilerOutput.php
includes/profiler/output/ProfilerOutputDb.php
includes/profiler/output/ProfilerOutputText.php
includes/profiler/output/ProfilerOutputUdp.php

index 12e999b..cd20311 100644 (file)
@@ -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() );
                        }
                }
        }
index e8e0085..3473e0b 100644 (file)
@@ -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 );
 }
index 3c2912e..e3cfd31 100644 (file)
@@ -35,7 +35,7 @@ class ProfilerOutputDb extends ProfilerOutput {
                return !wfReadOnly();
        }
 
-       protected function logStandardData( array $stats ) {
+       public function log( array $stats ) {
                global $wgProfilePerHost;
 
                if ( $wgProfilePerHost ) {
index 1fa7495..62c8088 100644 (file)
@@ -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 = '';
 
index c16ece2..a938861 100644 (file)
@@ -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 );