jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/389960 )
Change subject: Store stats of accessing ores service for getting thresholds
......................................................................
Store stats of accessing ores service for getting thresholds
Bug: T179862
Change-Id: Ie8a8b137d018b209c6d2f71089904caeade19f52
---
M includes/Stats.php
1 file changed, 6 insertions(+), 3 deletions(-)
Approvals:
jenkins-bot: Verified
Awight: Looks good to me, approved
diff --git a/includes/Stats.php b/includes/Stats.php
index 70bef9b..f53f968 100644
--- a/includes/Stats.php
+++ b/includes/Stats.php
@@ -85,15 +85,18 @@
$key = $this->cache->makeKey( 'ORES',
'threshold_statistics', $model, $wgOresCacheVersion );
$result = $this->cache->getWithSetCallback(
$key,
- // FIXME: Should be TTL_DAY, set to TTL_MINUTE
during the breaking transition.
- \WANObjectCache::TTL_MINUTE,
+ \WANObjectCache::TTL_DAY,
function () use ( $model ) {
+ $statsdDataFactory =
MediaWikiServices::getInstance()->getStatsdDataFactory();
// @deprecated Only catching exceptions
to allow the
// failure to be cached, remove once
transition is
// complete.
try {
- return
$this->fetchStatsFromApi( $model );
+ $result =
$this->fetchStatsFromApi( $model );
+ $statsdDataFactory->increment(
'ores.api.stats.ok' );
+ return $result;
} catch ( \RuntimeException $ex ) {
+ $statsdDataFactory->increment(
'ores.api.stats.failed' );
// Magic to trigger an
exception.
return -1;
}
--
To view, visit https://gerrit.wikimedia.org/r/389960
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie8a8b137d018b209c6d2f71089904caeade19f52
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits