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

Improve Brave ads serving pipeline performance #10580

Merged
merged 1 commit into from
Oct 22, 2021
Merged

Improve Brave ads serving pipeline performance #10580

merged 1 commit into from
Oct 22, 2021

Conversation

tmancey
Copy link
Collaborator

@tmancey tmancey commented Oct 18, 2021

Resolves brave/brave-browser#18843

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

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:

  • user should be rewarded for viewing the following types of ad:
    • push notification ads
    • inline content ads
    • promoted content ads
    • new tab page ads
  • confirm ads are served for:
    • push notification ads for v1 pipeline (parent-child, parent and untargeted segments)
    • push notification ads for v2 pipeline
    • Confirm CPU usage for 4,200+ entries in the 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 pipeline
    • Confirm CPU usage for 4,200+ entries in the 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 v2 pipeline
    • inline content ads for v1 pipeline (untargeted segments)
    • inline content ads for v2 pipeline
  • frequency caps working as expected for:
    • anti-targeting (capped against creative set)
    • conversion (capped against creative set)
    • daily cap (capped against campaign)
    • day-parting (capped against creative set)
    • dislike (thumbs down icon in ads history, capped against creative set)
    • dismissed (user closed push notification ad, capped against campaign)
    • marked as inappropriate (via kebab menu in ads history, capped against creative set)
    • marked to no longer receive (no entry icon in ads history, capped against creative set)
    • per day (capped against creative set)
    • per hour (capped against creative instance)
    • per month (capped against creative set)
    • per week (capped against creative set)
    • split test (capped against creative set)
    • subdivision targeting (capped against creative set)
    • total max (capped against creative set)
    • transferred (aka Landed, capped against campaign)
  • Ad pacing (ptr in catalog)
  • Ad prioritization (priority in catalog)
  • Upgrade path from 1.33.30 (database schema 16) to 1.33.31 or above (database schema 17)

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.

@tmancey tmancey self-assigned this Oct 18, 2021
@tmancey tmancey force-pushed the issues/18843 branch 4 times, most recently from 4c91ebe to a6a7c74 Compare October 18, 2021 22:47
@tmancey tmancey force-pushed the issues/18843 branch 8 times, most recently from 987959d to 0ff00af Compare October 19, 2021 21:07
@tmancey
Copy link
Collaborator Author

tmancey commented Oct 20, 2021

This is the one we spoke about yesterday and decided not

@tmancey tmancey requested a review from aseren October 20, 2021 13:13
@tmancey tmancey force-pushed the issues/18843 branch 9 times, most recently from 6835916 to 81c9b2c Compare October 20, 2021 14:03
@tmancey tmancey force-pushed the issues/18843 branch 15 times, most recently from 73a9203 to 66f3f80 Compare October 22, 2021 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Brave ads serving pipeline performance
2 participants