Create analytics module to gather and send front-end and user analytics data

RESOLVED FIXED in M3

Status

Pancake
Front-end
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: sfoster, Assigned: sfoster)

Tracking

unspecified
x86
Mac OS X

Details

(Assignee)

Description

6 years ago
We need a simple mechanism to gather analytics data that is only available in the front-end, and have that sent back to the server. 

It should buffer or queue up requests so we don't have one request per data-point which would likely perform horribly.
(Assignee)

Comment 1

6 years ago
I've made a start on this in the frontend-analytics branch. 
I'm porting the dojox.analytics module from Dojo which I've used before and does all this. 
So far I've got the core functionality which queues up data and periodically flushes to the server. There's a few plugins for gathering specific analytics stuff that I might also port - like an idle/active plugin, window/client plugin etc.
(Assignee)

Comment 2

6 years ago
modules and tests written and the loadtime functionality wired into main-bb in: https://bitbucket.org/mozillapancake/pancake/changeset/4ad0ed40306f

..that gathers load-time data and ends up making a request to /api/analytics with body like: 

{"id":1,"data":[{"loadtime.start":1335974050202,"loadtime.end":1335974064633,"loadtime.elapsed":14431}],"csrf_token":"0ad1b3453d3d936f3adb9a2437cbb4f6705583df"}

Not sure where the data should ultimately be sent, but this looks complete as far as the front-end goes. Holding off merging into default until there's an endpoint to receive it.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Updated

6 years ago
Blocks: 751553
(Assignee)

Comment 3

6 years ago
I merged this to default and closed the frontend-analytics branch. When /main finishes loading and initialization, a POST to config.analyticsUrl is made with the loadtime analytics data.
Please send data in the format below to: /lattice/stats

[
 {
   "js.loadtime": {
      "timestamp": 1339639106845,
      "elapsed" : 1590
   }
 },
 ...,
 {..}
]

There will be a whitelist for allowed 'buckets'.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
{'data': [
...
]}

Might be better actually
API implemented.

Sample curl command:

curl -v -X POST -d '{"data":[{"js.loadtime":{"timestamp": 1339639106845, "elapsed":1590}}]}' 'http://localhost:6543/lattice/stats'
(Assignee)

Comment 7

6 years ago
Fixed in: https://bitbucket.org/mozillapancake/pancake/changeset/0ede7a6aa9f8
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.