Krinkle has uploaded a new change for review.
https://gerrit.wikimedia.org/r/258072
Change subject: Move inline $wgStatsdMetricPrefix default to Setup.php
......................................................................
Move inline $wgStatsdMetricPrefix default to Setup.php
This allows other code paths to use the variable without hardcoding
the default (e.g. ExtensionDistributor).
Change-Id: Ia43ab5eda70d4b9952b4e0ad3334f884919b4dac
---
M includes/Setup.php
M includes/context/RequestContext.php
2 files changed, 5 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/72/258072/1
diff --git a/includes/Setup.php b/includes/Setup.php
index a94bd12..6fc8e27 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -492,6 +492,10 @@
$wgSessionsInObjectCache = true;
}
+if ( $wgStatsdMetricPrefix === false ) {
+ $wgStatsdMetricPrefix = 'MediaWiki';
+}
+
Profiler::instance()->scopedProfileOut( $ps_default );
// Disable MWDebug for command line mode, this prevents MWDebug from eating up
diff --git a/includes/context/RequestContext.php
b/includes/context/RequestContext.php
index 4f8e65d..dbed585 100644
--- a/includes/context/RequestContext.php
+++ b/includes/context/RequestContext.php
@@ -135,10 +135,7 @@
*/
public function getStats() {
if ( $this->stats === null ) {
- $config = $this->getConfig();
- $prefix = $config->get( 'StatsdMetricPrefix' )
- ? rtrim( $config->get( 'StatsdMetricPrefix' ),
'.' )
- : 'MediaWiki';
+ $prefix = rtrim( $this->getConfig()->get(
'StatsdMetricPrefix' ), '.' );
$this->stats = new BufferingStatsdDataFactory( $prefix
);
}
return $this->stats;
--
To view, visit https://gerrit.wikimedia.org/r/258072
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia43ab5eda70d4b9952b4e0ad3334f884919b4dac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits