Closed Bug 749604 Opened 13 years ago Closed 13 years ago

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

Categories

(Pancake Graveyard :: Front-end, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sfoster, Assigned: sfoster)

References

Details

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.
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.
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
Closed: 13 years ago
Resolution: --- → FIXED
Blocks: 751553
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'
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.