Improve Brave ads serving pipeline performance #10580
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves brave/brave-browser#18843
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
As a minimum QA should test areas highlighted in BOLD. Other areas were unit tested before the changes. For performance tests: Join rewards (for United States), Quit browser, Replace
database.sqlite
, Launch browser and then serve an ad (monitor performance in the console log).Regression test Brave ads including:
ad_events
database table and a large catalog, i.e. United States (QA please reach out via DM for test file. NOTE: entries are purged after 3 months) for push notification ads v1 pipelinead_events
database table and a large catalog, i.e. United States (QA please reach out via DM for test file. NOTE: entries are purged after 3 months) for push notification ads v2 pipelineptr
in catalog)priority
in catalog)NOTE: Frequency caps were more detailed in the diagnostic logs prior to this change, however going forward we will not see a complete list of reasons why ads were capped due to the caching of already capped campaign, advertiser, creative set and creative instance ids to reduce the amount of business logic we run. i.e., if an ad was capped due to creative set any other ad capped for the same creative set would also be capped but not logged.