increase perfomance ticker and remove empty batches
This commit is contained in:
parent
999e5cba3a
commit
8ecc67c745
2 changed files with 12 additions and 1 deletions
|
|
@ -272,6 +272,7 @@ export default class App {
|
|||
'feature-flags': true,
|
||||
'usability-test': true,
|
||||
}
|
||||
private emptyBatchCounter = 0
|
||||
|
||||
constructor(
|
||||
projectKey: string,
|
||||
|
|
@ -872,6 +873,16 @@ export default class App {
|
|||
return
|
||||
}
|
||||
|
||||
if (!this.messages.length) {
|
||||
if (this.emptyBatchCounter < 1000) {
|
||||
this.emptyBatchCounter++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.emptyBatchCounter = 0
|
||||
console.log('messages', this.messages.join(', '))
|
||||
|
||||
try {
|
||||
requestIdleCb(() => {
|
||||
this.messages.unshift(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