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:
parent
50e08c7560
commit
0934006817
1 changed files with 9 additions and 0 deletions
|
@ -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);
|
const krh = new KeyRequestHandler(cli);
|
||||||
cli.on("crypto.roomKeyRequest", (req) => {
|
cli.on("crypto.roomKeyRequest", (req) => {
|
||||||
krh.handleKeyRequest(req);
|
krh.handleKeyRequest(req);
|
||||||
|
|
Loading…
Reference in a new issue