Improve tracker perfomance (#3208)
* fix(helm): add CORS config to Assist ingress Configure CORS headers and debug session information for the Assist service's ingress to ensure proper cross-origin requests handling and improved debugging capabilities. Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com> * increase perfomance ticker and remove empty batches * add commit * updated Changelog --------- Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com> Co-authored-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
parent
4cf688f15c
commit
666643a6ae
3 changed files with 18 additions and 1 deletions
|
|
@ -1,3 +1,8 @@
|
|||
## 16.1.1
|
||||
|
||||
- reduced the frequency of performance tracker calls
|
||||
- reduced the number of events when the user is idle
|
||||
|
||||
## 16.1.0
|
||||
|
||||
- new `privateMode` option to hide all possible data from tracking
|
||||
|
|
|
|||
|
|
@ -272,6 +272,7 @@ export default class App {
|
|||
'feature-flags': true,
|
||||
'usability-test': true,
|
||||
}
|
||||
private emptyBatchCounter = 0
|
||||
|
||||
constructor(
|
||||
projectKey: string,
|
||||
|
|
@ -871,6 +872,17 @@ export default class App {
|
|||
return
|
||||
}
|
||||
|
||||
if (!this.messages.length) {
|
||||
// Release empty batches every 30 secs (1000 * 30ms)
|
||||
if (this.emptyBatchCounter < 1000) {
|
||||
this.emptyBatchCounter++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.emptyBatchCounter = 0
|
||||
console.log('messages', this.messages.join(', '))
|
||||
|
||||
try {
|
||||
requestIdleCb(() => {
|
||||
this.messages.unshift(Timestamp(this.timestamp()), TabData(this.session.getTabId()))
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ export default function (app: App, opts: Partial<Options>): void {
|
|||
ticks = frames = undefined
|
||||
})
|
||||
|
||||
app.ticker.attach(sendPerformanceTrack, 40, false)
|
||||
app.ticker.attach(sendPerformanceTrack, 165, false)
|
||||
|
||||
if (document.hidden !== undefined) {
|
||||
app.attachEventListener(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue