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

AMP FTS metrics #6560

Merged
merged 1 commit into from
Jan 17, 2025
Merged

AMP FTS metrics #6560

merged 1 commit into from
Jan 17, 2025

Conversation

bendk
Copy link
Contributor

@bendk bendk commented Jan 15, 2025

These seem like they could be useful for the experiment. I'm not sure we'll be able to hook them up but we might as well try.

Refactored the logic to get the full keywords and added tests for it since we're now using it in two places.

PR note: This one's on top of the other since I think that one's pretty close to landing and this one I'm less sure of. The second commit has changes specific to this one.

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

Branch builds: add [firefox-android: branch-name] to the PR title.

@bendk bendk requested a review from 0c0w3 January 15, 2025 21:54
Copy link
Contributor

@0c0w3 0c0w3 left a comment

Choose a reason for hiding this comment

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

Thanks, lgtm.

for term in fts_content.split_whitespace() {
*actual_counts.entry(term).or_default() += 1;
}
assert_eq!(actual_counts, expected_counts);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not simply assert_eq!(fts_content, expected)? That would simplify this test logic, making bugs less likely, and I think it's OK to make an assumption about the order of words in fts_content.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was my first try, but the HashSet messes it all up because the order changes each test.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, I didn't realize that.

@bendk bendk force-pushed the push-unrssxklpums branch 2 times, most recently from 1b4f7b4 to 502af68 Compare January 16, 2025 17:07
These seem like they could be useful for the experiment.  I'm not sure
we'll be able to hook them up but we might as well try.

Refactored the logic to get the full keywords and added tests for it
since we're now using it in two places.
@bendk bendk force-pushed the push-unrssxklpums branch from 502af68 to fff3e9e Compare January 17, 2025 13:39
@bendk bendk enabled auto-merge January 17, 2025 13:39
@bendk bendk added this pull request to the merge queue Jan 17, 2025
Merged via the queue into mozilla:main with commit 2593471 Jan 17, 2025
15 checks passed
@bendk bendk deleted the push-unrssxklpums branch January 17, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants