You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Track UISIs in bulk
Piwik supports sending an event value, which we can use to indicate cardinality of UISIs to be tracked instead of tracking them individually. This means we can track them at a lower frequency of (fairly arbitrary) 60s.
This commit is contained in:
@@ -40,9 +40,8 @@ export default class DecryptionFailureTracker {
|
||||
checkInterval = null;
|
||||
trackInterval = null;
|
||||
|
||||
// Spread the load on `Analytics` by sending at most 1 event per
|
||||
// `TRACK_INTERVAL_MS`.
|
||||
static TRACK_INTERVAL_MS = 1000;
|
||||
// Spread the load on `Analytics` by tracking at a low frequency, `TRACK_INTERVAL_MS`.
|
||||
static TRACK_INTERVAL_MS = 60000;
|
||||
|
||||
// Call `checkFailures` every `CHECK_INTERVAL_MS`.
|
||||
static CHECK_INTERVAL_MS = 5000;
|
||||
@@ -163,7 +162,8 @@ export default class DecryptionFailureTracker {
|
||||
*/
|
||||
trackFailure() {
|
||||
if (this.failuresToTrack.length > 0) {
|
||||
this.trackDecryptionFailure(this.failuresToTrack.shift());
|
||||
// Remove all failures, and expose the number of failures
|
||||
this.trackDecryptionFailure(this.failuresToTrack.splice(0).length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user