Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to queue tracking requests so they are sent in bulk #13616

Merged
merged 5 commits into from Nov 29, 2018

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Oct 16, 2018

No description provided.

@tsteur tsteur added the Needs Review PRs that need a code review label Oct 16, 2018
@tsteur tsteur added this to the 3.7.0 milestone Oct 16, 2018
clearTimeout(this.timeout);
this.timeout = null;
}
// we always extend by another 1.75 seconds after receiving a tracking request
Copy link
Member Author

@tsteur tsteur Oct 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't decide between 1.5 and 2 seconds :) the earlier we send it, the more likely the request won't fail I suppose.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi #13444 will be useful to have to ensure the bulk request won't be too large in case tracking requests keep getting queued

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could make the time configurable. At least that way it won't require a commit to core to experiment with it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to not make it configurable for now to keep it simple but could add it later if needed. For now only premium features will use it anyway I think. Although could maybe also start using it for content impressions eventually. The defined interval shouldn't make too much of a difference.

sendRequest(requestsToTrack[0]);
} else {
sendBulkRequest(requestsToTrack);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does sending a single request vs bulk request w/ single entry make a big difference?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't make too much of a big difference. Although... for bulk requests we currently don't fallback to GET requests and always do a POST request compared to usually GET request, and it will be wrapped with {"requests":["?' + requests.join('","?') + '"]} so not sure if it can be replayed easily using log analytics etc.

I would say it is better when possible to use sendRequest when there is only one request and keep differentiating.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see 👍

@diosmosis
Copy link
Member

Left some comments, otherwise looks good.

@tsteur
Copy link
Member Author

tsteur commented Nov 29, 2018

@diosmosis I'll merge for now so I can merge it into #13596 and resolve merge conflicts etc. Let me know if I should change anything further.

@tsteur tsteur merged commit 970883b into 3.x-dev Nov 29, 2018
@tsteur tsteur deleted the queuerequests branch November 29, 2018 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants