Commit graph

26 commits

Author SHA1 Message Date
David Lynch e66d58076f trackSubscriber: data isn't required
Editor-fixing caused errors on some events which don't pass data in.

Introduced in 8f612fbe64.

Change-Id: I5c9471e6ffe4cdda0bf5455c80ef70251690e20f
2017-12-13 11:56:35 -06:00
Ed Sanders 8f612fbe64 Pass editor mode (visual/source) to tracking code
Change-Id: Iba5d3c66ecbd2872d76ea12f795ef3bebaae9d81
2017-12-07 11:14:00 +00:00
Ed Sanders 835a775a49 build: Upgrade grunt-eslint from 19.0.0 to 20.0.0
Mostly indent and regex fixes.

Change-Id: Iaf9d02363c78cb71deec5c4cab53a05b67f60600
2017-07-18 12:55:33 +01:00
James D. Forrester 122f49b2dd build: Bump file copyright notices for 2017
Change-Id: I3c20809e71cc0da58123e1b5f29c4f3aac945496
2017-01-03 08:58:33 -08:00
Ed Sanders 37ccaca2ec eslint: Re-enable wrap-iife and partially enable dot-notation
Change-Id: I4420d66f528dcb18ebe2b9f63996661b2969f833
2016-11-12 14:43:43 +00:00
James D. Forrester a1db489d95 ve.init.mw.trackSubscriber: Sample at 6.25%
Bug: T125598
Change-Id: I1915a6456ba5dfc10e4a52df24cee2e68b27e526
2016-02-08 13:22:33 -08:00
James D. Forrester ada58df361 build: Bump file copyright notices for 2016
Change-Id: I3c618c196e504a80ca297a4132a17f1977a24fb7
2016-01-03 14:57:25 -08:00
James D. Forrester 486bc7e6e3 mw.trackSubscriber: Log platform as phone vs. desktop
Change-Id: I71c25f28098c72ed779117da9c243dc3a87e611d
2015-09-05 21:29:03 +00:00
Alex Monk 6d94d060ac Bump Schema:Edit to revision 13457736
* Remove page.length
* Add action.abort.type = switchnochange

Needs to be deployed at the same time as Ib99700ac

Bug: T111420
Change-Id: I7ee245157d4de6c220d7cdf54cd1dd69ff836f15
2015-09-04 00:51:05 +00:00
James D. Forrester 19df1d4c8a build: Enable jscs rule 'requireVarDeclFirst' and make pass
Change-Id: Ia2f765d12bde001c329c2ff4c080a36b71de9803
2015-08-19 11:05:01 -07:00
James D. Forrester f5c6f61163 build: Enable jscs rule 'requireSpacesInsideBrackets' and make pass
Change-Id: I846d36c15e1b1f810d2ef7fd422f8412790bcb0f
2015-08-19 10:33:02 -07:00
Alex Monk 19dc7d31fe Set targetName for apiLoad and restbaseLoad metrics to the correct values again
If70ff601 didn't really fix anything. The only reason you'd want this data is
to distinguish between mobile and desktop data, but it just set the value to
the desktop version always...

Bug: T95432
Change-Id: I76722e3ad8b7dbe644374b24093bec696f27f48c
2015-04-09 13:57:25 +01:00
Ori Livneh 94877eb668 Set mwtiming events' target to 'mwTarget', if unset
We're currently rewriting "mwtiming.performance.system.domLoad" to
"timing.ve.undefined.performance.system.domLoad". The "undefined" comes from
the missing targetName property on the event. I'm not sure why it is missing,
but having it default to 'mwTarget' will Do the Right Thing™.

Task: T93156
Change-Id: If70ff601b6c54ec8f95171cbc43c82c87a177508
2015-03-19 00:40:28 +00:00
Alex Monk 88088d4ecc Set action.saveFailure.message key in Edit schema
This relies on WikimediaMessages' version of the Edit schema being updated at
the same time.

Change-Id: Iee97fdd2a867f2c252ca7756f2e6341377d9fbb7
2015-03-18 22:24:40 +00:00
Alex Monk 6f1b6c85a5 Send abort event on unload
Still misses some preinit aborts because we need to figure out
a way to attach the unload handler early enough to catch these.

Change-Id: I0ce721e24e69c31318064c6b443c1bfe01077546
2015-03-03 15:25:57 +00:00
Roan Kattouw c57b89616d Follow-up 14a4a4ae1: *actually* fix back compat for this.timeStamp
Introducing a variable doesn't help if you then don't use it :|

Change-Id: Ibf1c230dcb8b17941fcd6e0c82dd7a054a3287f0
2015-02-23 16:14:07 +00:00
Roan Kattouw 14a4a4ae1e Follow-up 9b582485: implement back compat for timeStamp correctly
timeStamp was used in two places, but we only had back-compat
code in one, so the other ended up using NaN.

Bonus: make jshint happy with the indentation of the $.extend() call.

Change-Id: I69000d11822658f2a227f9756093bc278f5fbaf5
2015-02-22 18:33:19 +00:00
Alex Monk c6dbdc92ea Don't try to route any events into schema.Edit if it's not actually installed
E.g. no WikimediaEvents

Bug: T88667
Change-Id: I33a13abf22da0caa1282652fa1a078ffcae11e97
2015-02-21 02:41:33 +00:00
Ori Livneh 9b582485f9 Fix ve.init.mw.trackSubscriber.js
* Use the event's timeStamp rather than the current time in the event
  subscriber.
* Instead of using ve.trackSubscribeAll() and then branching on the topic
  prefix, just use ve.trackSubscribe( prefix, ... ) to bind prefix-specific
  handlers.
* Round timing measurements after performing arithmetic, and use Math#round
  rather than Math#floor.
* Rename 'getDefaultTiming' to 'computeDuration'.

Change-Id: I27ff1622ecea9b82d414f871441f127fc2dbd2cc
2015-02-20 14:00:26 -08:00
Ori Livneh 429d55cda8 Update ve.init.mw.trackSubscriber to emit 'wgVersion'
Depends on I6cebac796: Update Edit schema to revision 11319708.

Change-Id: I31ce78a573ef0cdab1162c6b78142fd511b9e0ec
2015-02-19 11:20:53 -08:00
James D. Forrester 2f8b3e0d96 build: Bump copyright notices to 2015
Change-Id: Ie92dab7411116d3410195c3fb0a3513c664c0c30
2015-01-12 20:34:19 -08:00
Roan Kattouw a032ea039e Move from legacy TimingData schema to new statsd API
This API doesn't have the ability to track any other data
in addition to a name and a duration in milliseconds, so
we add the target name ('mwTarget' or 'mobile') to the
event name and discard all other data.

Change-Id: I25ae0243f8983142d7755b65b05c18d5df36a253
2014-12-10 00:25:42 +00:00
Timo Tijhof ee954cbdd5 Use String#slice instead of discouraged String#substr
Aside from the confusion and differences between substr() and
substring() and IE8 bugs with substr(), substr() was removed from
the spec as of ECMAScript 5. It's been standardised in the
optional Annex B section of ES5.

Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1
2014-12-06 21:26:20 +00:00
Catrope 64ce195fae Revert "ve.init.mw.trackSubscriber: Populate platform field with hack"
Caused JS errors when invoked too early.

This reverts commit 35d3898543.

Change-Id: Ie7dd4ef8323a16bb694e6300a096ba53cf4a0a91
2014-11-26 01:55:30 +00:00
Roan Kattouw 35d3898543 ve.init.mw.trackSubscriber: Populate platform field with hack
Use the target used as a proxy for the platform.
Assuming all mobile target users are tablets for now.

Change-Id: I24610e6b6d472744dc1011385c8810a65e06decf
2014-11-25 17:23:50 -08:00
Roan Kattouw 6d21d83244 Add instrumentation for edit schema
Move ve.track() subscriber to its own file, and have it
route mwtiming.* events (for TimingData) and mwedit.* events
(for Edit schema) differently. Most of the data population
lives in the subscriber, so actual ve.track() calls are
pretty lightweight.

Existing ve.track() calls with timing data were kept with
their names intact for backwards compatibility, but
we may eventually want to throw them out and start from scratch.

ve.init.mw.ViewPageTarget.init.js:
* Remove old track subscriber
* Track init and ready events
* Remove old ve.track( 'Edit', ... ) crap that didn't work

ve.init.mw.ViewPageTarget.js:
* Fire the saveWorkflowBegin event before the save dialog
  loads rather than after
* Remove unnecessary this.events.trackSaveError() calls:
  TargetEvents already listens to these events itself
* Remove badtoken handler because all it was was an
  unnecessary trackSaveError() call
* Add abort tracking
** Pass trackMechanism through deactivate() and cancel()

ve.init.mw.Target.js:
* Add static.integrationType to populate the 'integration'
  field in the schema

ve.init.mw.TargetEvents.js:
* Simplify onSaveError* methods away into connect bindings
* Map track topics to mwtiming.* so they can be routed separately
* Track save-related mwedit.* events

Depends on I978eda96c in WikimediaEvents

Change-Id: Iae677d9b15c71d2b18e795bd5179d11876c06abd
2014-11-21 11:59:15 -08:00