Track decryption success/failure rate with piwik

Emit a piwik event when a decryption occurs in the category "E2E" with
the action "Decryption result" and the name either "failure" or
"success".

NB: This will cause Riot to a lot of networking when decrypting many
events. One HTTP request per decrypted event should be expected.
This commit is contained in:
Luke Barnard 2018-06-12 14:13:09 +01:00
parent 50e08c7560
commit 0934006817

View File

@ -1308,6 +1308,15 @@ export default React.createClass({
}
});
// XXX: This will do a HTTP request for each Event.decrypted event
cli.on("Event.decrypted", (e) => {
if (e.isDecryptionFailure()) {
Analytics.trackEvent('E2E', 'Decryption result', 'failure');
} else {
Analytics.trackEvent('E2E', 'Decryption result', 'success');
}
});
const krh = new KeyRequestHandler(cli);
cli.on("crypto.roomKeyRequest", (req) => {
krh.handleKeyRequest(req);