From b6be73dd87c6450885c40b87cb6eac159220fba3 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Thu, 30 Oct 2014 15:18:22 -0700 Subject: [PATCH] Remove collateOnly() from ProfilerStandard and subclasses All implementations had this set to true, so remove the needless abstraction and function calls. Child classes that do want to differentiate here can just set the member variable on construction. Change-Id: I81a4e6605bdec1fc1a977b5aa1ee1c5853d5ca5b --- includes/profiler/ProfilerSimpleDB.php | 4 ---- includes/profiler/ProfilerSimpleText.php | 4 ---- includes/profiler/ProfilerSimpleTrace.php | 4 ---- includes/profiler/ProfilerSimpleUDP.php | 4 ---- includes/profiler/ProfilerStandard.php | 18 ++---------------- 5 files changed, 2 insertions(+), 32 deletions(-) diff --git a/includes/profiler/ProfilerSimpleDB.php b/includes/profiler/ProfilerSimpleDB.php index 7ef0ad05c58..5e62f7c8b44 100644 --- a/includes/profiler/ProfilerSimpleDB.php +++ b/includes/profiler/ProfilerSimpleDB.php @@ -27,10 +27,6 @@ * @ingroup Profiler */ class ProfilerSimpleDB extends ProfilerStandard { - protected function collateOnly() { - return true; - } - public function isPersistent() { return true; } diff --git a/includes/profiler/ProfilerSimpleText.php b/includes/profiler/ProfilerSimpleText.php index 0ee7aad23bc..2d96b88827c 100644 --- a/includes/profiler/ProfilerSimpleText.php +++ b/includes/profiler/ProfilerSimpleText.php @@ -42,10 +42,6 @@ class ProfilerSimpleText extends ProfilerStandard { parent::__construct( $profileConfig ); } - protected function collateOnly() { - return true; - } - public function logData() { if ( $this->mTemplated ) { $this->close(); diff --git a/includes/profiler/ProfilerSimpleTrace.php b/includes/profiler/ProfilerSimpleTrace.php index 2a4449483c5..95e4bc6d292 100644 --- a/includes/profiler/ProfilerSimpleTrace.php +++ b/includes/profiler/ProfilerSimpleTrace.php @@ -30,10 +30,6 @@ class ProfilerSimpleTrace extends ProfilerStandard { protected $trace = "Beginning trace: \n"; protected $memory = 0; - protected function collateOnly() { - return true; - } - public function profileIn( $functionname ) { parent::profileIn( $functionname ); diff --git a/includes/profiler/ProfilerSimpleUDP.php b/includes/profiler/ProfilerSimpleUDP.php index 627b4de269b..02405afc985 100644 --- a/includes/profiler/ProfilerSimpleUDP.php +++ b/includes/profiler/ProfilerSimpleUDP.php @@ -28,10 +28,6 @@ * @ingroup Profiler */ class ProfilerSimpleUDP extends ProfilerStandard { - protected function collateOnly() { - return true; - } - public function isPersistent() { return true; } diff --git a/includes/profiler/ProfilerStandard.php b/includes/profiler/ProfilerStandard.php index cc134165760..a65e53eb831 100644 --- a/includes/profiler/ProfilerStandard.php +++ b/includes/profiler/ProfilerStandard.php @@ -40,8 +40,8 @@ class ProfilerStandard extends Profiler { protected $mCollated = array(); /** @var bool */ protected $mCollateDone = false; - /** @var bool */ - protected $mCollateOnly = false; + /** @var bool Whether to collect the full stack trace or just aggregates */ + protected $mCollateOnly = true; /** @var array Cache of a standard broken collation entry */ protected $mErrorEntry; @@ -51,8 +51,6 @@ class ProfilerStandard extends Profiler { public function __construct( array $params ) { parent::__construct( $params ); - $this->mCollateOnly = $this->collateOnly(); - $this->addInitialStack(); } @@ -76,18 +74,6 @@ class ProfilerStandard extends Profiler { } /** - * Whether to internally just track aggregates and ignore the full stack trace - * - * Only doing collation saves memory overhead but limits the use of certain - * features like that of graph generation for the debug toolbar. - * - * @return bool - */ - protected function collateOnly() { - return false; - } - - /** * Add the inital item in the stack. */ protected function addInitialStack() { -- 2.11.4.GIT