Nuria has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381496 )

Change subject: [WIP] Removing logging of PageContentSaveComplete
......................................................................

[WIP] Removing logging of PageContentSaveComplete

This also removes logging of NewEditorEdit, need to confirm
data is no longer used

Bug: T177101
Change-Id: I2b33a8fddd72665f732be3385a1f57c0d5e25985
---
M WikimediaEventsHooks.php
M extension.json
2 files changed, 0 insertions(+), 94 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents 
refs/changes/96/381496/1

diff --git a/WikimediaEventsHooks.php b/WikimediaEventsHooks.php
index f2d7bee..7df1ef7 100644
--- a/WikimediaEventsHooks.php
+++ b/WikimediaEventsHooks.php
@@ -60,97 +60,6 @@
        }
 
        /**
-        * Log server-side event on successful page edit.
-        *
-        * Imported from EventLogging extension
-        *
-        * @param WikiPage $article
-        * @param User $user
-        * @param Content $content
-        * @param string $summary
-        * @param bool $isMinor
-        * @param bool $isWatch
-        * @param string $section
-        * @param int $flags
-        * @param Revision $revision
-        * @param Status $status
-        * @param int $baseRevId
-        * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/PageContentSaveComplete
-        * @see https://meta.wikimedia.org/wiki/Schema:PageContentSaveComplete
-        */
-       public static function onPageContentSaveComplete(
-               $article, $user, $content, $summary,
-               $isMinor, $isWatch, $section, $flags, $revision, $status, 
$baseRevId
-       ) {
-               if ( !$revision ) {
-                       return;
-               }
-
-               $stats = 
MediaWikiServices::getInstance()->getStatsdDataFactory();
-               if ( PHP_SAPI !== 'cli' ) {
-                       $size = $content->getSize();
-                       DeferredUpdates::addCallableUpdate( function () use ( 
$stats, $size ) {
-                               $timing = 
RequestContext::getMain()->getTiming();
-                               $measure = $timing->measure( 
'editResponseTime', 'requestStart', 'requestShutdown' );
-                               if ( $measure !== false ) {
-                                       $stats->timing( 
'timing.editResponseTime', $measure['duration'] * 1000 );
-                               }
-                               $stats->gauge( 'edit.newContentSize', $size );
-                       } );
-               }
-
-               $isAPI = defined( 'MW_API' );
-               $isMobile = class_exists( 'MobileContext' )
-                       && 
MobileContext::singleton()->shouldDisplayMobileView();
-               $revId = $revision->getId();
-               $title = $article->getTitle();
-
-               $event = [
-                       'revisionId' => $revId,
-                       'isAPI'      => $isAPI,
-                       'isMobile'   => $isMobile,
-               ];
-
-               if ( isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {
-                       $event[ 'userAgent' ] = $_SERVER[ 'HTTP_USER_AGENT' ];
-               }
-               EventLogging::logEvent( 'PageContentSaveComplete', 5588433, 
$event );
-
-               if ( $user->isAnon() ) {
-                       return;
-               }
-
-               // Get the user's age, measured in seconds since registration.
-               $age = time() - wfTimestampOrNull( TS_UNIX, 
$user->getRegistration() );
-
-               $editCount = $user->getEditCount();
-
-               // Check if this edit brings the user's total edit count to a 
value
-               // that is a factor of ten. We consider these 'milestones'. The 
rate
-               // at which editors are hitting such milestones and the time it 
takes
-               // are important indicators of community health.
-               if ( $editCount === 0 || preg_match( '/^9+$/', "$editCount" ) ) 
{
-                       $milestone = $editCount + 1;
-                       $stats->increment( "editor.milestones.{$milestone}" );
-                       $stats->timing( 
"editor.milestones.timing.{$milestone}", $age );
-               }
-
-               // If the editor signed up in the last thirty days, and if this 
is an
-               // NS_MAIN edit, log a NewEditorEdit event.
-               if ( $age <= 2592000 && $title->inNamespace( NS_MAIN ) ) {
-                       EventLogging::logEvent( 'NewEditorEdit', 6792669, [
-                                       'userId'    => $user->getId(),
-                                       'userAge'   => $age,
-                                       'editCount' => $editCount,
-                                       'pageId'    => $article->getId(),
-                                       'revId'     => $revId,
-                                       'isAPI'     => $isAPI,
-                                       'isMobile'  => $isMobile,
-                               ] );
-               }
-       }
-
-       /**
         * Log and update statistics whenever an editor reaches the active 
editor
         * threshold for this month.
         *
diff --git a/extension.json b/extension.json
index f682d51..1e1f6ab 100644
--- a/extension.json
+++ b/extension.json
@@ -20,9 +20,6 @@
                "BeforePageDisplay": [
                        "WikimediaEventsHooks::onBeforePageDisplay"
                ],
-               "PageContentSaveComplete": [
-                       "WikimediaEventsHooks::onPageContentSaveComplete"
-               ],
                "UserSaveOptions": [
                        "WikimediaEventsHooks::onUserSaveOptions"
                ],

-- 
To view, visit https://gerrit.wikimedia.org/r/381496
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2b33a8fddd72665f732be3385a1f57c0d5e25985
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: master
Gerrit-Owner: Nuria <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to