mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Merge "Hook up VisualEditorFeatureUse logging"
This commit is contained in:
commit
0179e00197
|
@ -130,4 +130,10 @@ ReplyWidgetVisual.prototype.setPending = function ( pending ) {
|
|||
}
|
||||
};
|
||||
|
||||
ve.trackSubscribe( 'activity.', function ( topic, data ) {
|
||||
mw.track( 'dt.schemaVisualEditorFeatureUse', ve.extendObject( data, {
|
||||
feature: topic.split( '.' )[ 1 ]
|
||||
} ) );
|
||||
} );
|
||||
|
||||
module.exports = ReplyWidgetVisual;
|
||||
|
|
|
@ -53,6 +53,17 @@ mw.loader.using( 'ext.eventLogging' ).done( function () {
|
|||
session_token: user.sessionId(),
|
||||
version: 1
|
||||
}
|
||||
),
|
||||
schemaVisualEditorFeatureUse = new Schema(
|
||||
'VisualEditorFeatureUse',
|
||||
sampleRate,
|
||||
// defaults:
|
||||
{
|
||||
user_id: user.getId(),
|
||||
user_editcount: mw.config.get( 'wgUserEditCount', 0 ),
|
||||
platform: 'desktop',
|
||||
integration: 'discussiontools'
|
||||
}
|
||||
);
|
||||
/* eslint-enable camelcase */
|
||||
|
||||
|
@ -188,4 +199,28 @@ mw.loader.using( 'ext.eventLogging' ).done( function () {
|
|||
);
|
||||
}
|
||||
} );
|
||||
|
||||
mw.trackSubscribe( 'dt.schemaVisualEditorFeatureUse', function ( topic, data ) {
|
||||
var event;
|
||||
|
||||
// eslint-disable-next-line camelcase
|
||||
session.editor_interface = data.editor_interface || session.editor_interface;
|
||||
|
||||
event = {
|
||||
feature: data.feature,
|
||||
action: data.action,
|
||||
editingSessionId: session.editing_session_id,
|
||||
// eslint-disable-next-line camelcase
|
||||
editor_interface: session.editor_interface
|
||||
};
|
||||
|
||||
if ( trackdebug ) {
|
||||
log( topic, event );
|
||||
} else {
|
||||
schemaVisualEditorFeatureUse.log( event, (
|
||||
mw.config.get( 'wgDTSchemaEditAttemptStepOversample' ) ||
|
||||
mw.config.get( 'wgWMESchemaEditAttemptStepOversample' )
|
||||
) ? 1 : sampleRate );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue