Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/214573
Change subject: Update context stats in SiteStatsUpdate
......................................................................
Update context stats in SiteStatsUpdate
In addition to updating the database / memcached, make SiteStatsUpdate also
update the context stats object with the deltas it is processing.
Change-Id: Icc12c07ab4233e1105a402b80d290bdb64df6ea7
(cherry picked from commit 6542746e6c18a19ab5937cb237aae72f0067dd33)
---
M includes/deferred/SiteStatsUpdate.php
1 file changed, 12 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/73/214573/1
diff --git a/includes/deferred/SiteStatsUpdate.php
b/includes/deferred/SiteStatsUpdate.php
index 3c77238..ae75a75 100644
--- a/includes/deferred/SiteStatsUpdate.php
+++ b/includes/deferred/SiteStatsUpdate.php
@@ -65,6 +65,8 @@
public function doUpdate() {
global $wgSiteStatsAsyncFactor;
+ $this->doUpdateContextStats();
+
$rate = $wgSiteStatsAsyncFactor; // convenience
// If set to do so, only do actual DB updates 1 every $rate
times.
// The other times, just update "pending delta" values in
memcached.
@@ -153,6 +155,16 @@
return $activeUsers;
}
+ protected function doUpdateContextStats() {
+ $stats = RequestContext::getMain()->getStats();
+ foreach ( array( 'edits', 'articles', 'pages', 'users',
'images' ) as $type ) {
+ $delta = $this->$type;
+ if ( $delta !== 0 ) {
+ $stats->updateCount( "site.$type", $delta );
+ }
+ }
+ }
+
protected function doUpdatePendingDeltas() {
$this->adjustPending( 'ss_total_edits', $this->edits );
$this->adjustPending( 'ss_good_articles', $this->articles );
--
To view, visit https://gerrit.wikimedia.org/r/214573
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc12c07ab4233e1105a402b80d290bdb64df6ea7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf7
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits