implemented amplitude metrics (#1141)
This commit is contained in:
parent
1a483cad55
commit
9b37e92a81
26 changed files with 774 additions and 528 deletions
|
@ -5,6 +5,7 @@ const mozlog = require('../log');
|
|||
const Limiter = require('../limiter');
|
||||
const wsStream = require('websocket-stream/stream');
|
||||
const fxa = require('../fxa');
|
||||
const { statUploadEvent } = require('../amplitude');
|
||||
|
||||
const { Duplex } = require('stream');
|
||||
|
||||
|
@ -105,6 +106,15 @@ module.exports = function(ws, req) {
|
|||
// in order to avoid having to check socket state and clean
|
||||
// up storage, possibly with an exception that we can catch.
|
||||
ws.send(JSON.stringify({ ok: true }));
|
||||
statUploadEvent({
|
||||
id: newId,
|
||||
ip: req.ip,
|
||||
owner,
|
||||
dlimit,
|
||||
timeLimit,
|
||||
anonymous: !user,
|
||||
size: limiter.length
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
log.error('upload', e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue