Aude has submitted this change and it was merged.
Change subject: (bug 45984) Logging for change notification lag.
......................................................................
(bug 45984) Logging for change notification lag.
This adds debug output to dispatchChanges.php and ChangeNotificationJob classes,
to allow monitoring and analysis of lagging change notifications.
Change-Id: I56742c90cfe32737d326b4021b5177387e237206
---
M lib/includes/ChangeNotificationJob.php
M lib/maintenance/dispatchChanges.php
2 files changed, 25 insertions(+), 1 deletion(-)
Approvals:
Aude: Verified; Looks good to me, approved
diff --git a/lib/includes/ChangeNotificationJob.php
b/lib/includes/ChangeNotificationJob.php
index 11d109f..80e1b99 100644
--- a/lib/includes/ChangeNotificationJob.php
+++ b/lib/includes/ChangeNotificationJob.php
@@ -131,6 +131,18 @@
//TODO: allow mock handler for testing
ChangeHandler::singleton()->handleChanges( $changes );
+ if ( $changes ) {
+ /* @var Change $last */
+ $n = count( $changes );
+ $last = end( $changes );
+
+ wfDebugLog( __CLASS__, __METHOD__ . ": processed $n
notifications, "
+ . "up to " . $last->getId() .
", timestamp " . $last->getTime() . "; "
+ . "Lag is " . $last->getAge() .
" seconds." );
+ } else {
+ wfDebugLog( __CLASS__, __METHOD__ . ": processed no
notifications." );
+ }
+
return true;
}
diff --git a/lib/maintenance/dispatchChanges.php
b/lib/maintenance/dispatchChanges.php
index d8a2e2c..bc9690a 100644
--- a/lib/maintenance/dispatchChanges.php
+++ b/lib/maintenance/dispatchChanges.php
@@ -257,7 +257,19 @@
$n = count( $changes );
- $this->log( "Posted $n changes to $wikiDB" );
+ if ( $n === 0 ) {
+ $this->log( "Posted no changes to $wikiDB (nothing to
do). "
+ . "Next ID is $continueAfter."
);
+ } else {
+ /* @var Change $last */
+ $last = end( $changes );
+
+ $this->log( "Posted $n changes to $wikiDB, "
+ . "up to ID " . $last->getId() . ", timestamp "
. $last->getTime() . ". "
+ . "Lag is " . $last->getAge() . " seconds. "
+ . "Next ID is $continueAfter." );
+ }
+
return $n;
}
--
To view, visit https://gerrit.wikimedia.org/r/53274
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I56742c90cfe32737d326b4021b5177387e237206
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Denny Vrandecic <[email protected]>
Gerrit-Reviewer: Jens Ohlig <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits