aboutsummaryrefslogtreecommitdiffstats
path: root/includes/profiler/output
diff options
context:
space:
mode:
authorAaron Schulz <aschulz@wikimedia.org>2019-03-13 10:27:38 -0700
committerAaron Schulz <aschulz@wikimedia.org>2019-03-13 10:27:38 -0700
commit58ee03b13d32b96d86aaf905fdfa8ac14241a5cc (patch)
tree7fac1140dbaa6c9fdfc943b6030ae0c6b2374006 /includes/profiler/output
parentfe3a04748bfa37a43872b8fff83565d37074807f (diff)
downloadmediawikicore-58ee03b13d32b96d86aaf905fdfa8ac14241a5cc.tar.gz
mediawikicore-58ee03b13d32b96d86aaf905fdfa8ac14241a5cc.zip
Avoid sending duplicate ProfilerOutputText comments/html
Change-Id: I4130845cdb7208b8456740e5dbaf8bf96e175f49
Diffstat (limited to 'includes/profiler/output')
-rw-r--r--includes/profiler/output/ProfilerOutput.php9
-rw-r--r--includes/profiler/output/ProfilerOutputText.php5
2 files changed, 14 insertions, 0 deletions
diff --git a/includes/profiler/output/ProfilerOutput.php b/includes/profiler/output/ProfilerOutput.php
index 20b07801b484..fe27c046e707 100644
--- a/includes/profiler/output/ProfilerOutput.php
+++ b/includes/profiler/output/ProfilerOutput.php
@@ -48,6 +48,15 @@ abstract class ProfilerOutput {
}
/**
+ * Does log() just send the data to the request/script output?
+ * @return bool
+ * @since 1.33
+ */
+ public function logsToOutput() {
+ return false;
+ }
+
+ /**
* Log MediaWiki-style profiling data
*
* @param array $stats Result of Profiler::getFunctionStats()
diff --git a/includes/profiler/output/ProfilerOutputText.php b/includes/profiler/output/ProfilerOutputText.php
index e3184dbf8a71..95b5ff95bc2c 100644
--- a/includes/profiler/output/ProfilerOutputText.php
+++ b/includes/profiler/output/ProfilerOutputText.php
@@ -35,6 +35,11 @@ class ProfilerOutputText extends ProfilerOutput {
parent::__construct( $collector, $params );
$this->thresholdMs = $params['thresholdMs'] ?? 1.0;
}
+
+ public function logsToOutput() {
+ return true;
+ }
+
public function log( array $stats ) {
if ( $this->collector->getTemplated() ) {
$out = '';