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 FXIOS-4785 [v106] Adds metrics to track number of history visits #11634

Merged
merged 1 commit into from
Aug 29, 2022

Conversation

tarikeshaq
Copy link
Contributor

@tarikeshaq tarikeshaq commented Aug 17, 2022

FXIOS-4785 #11635

Ahead of migrating the history storage to use the application-services places component, we want to track down the number of history visits in a user's database. This adds those metrics.

## Keeping as a draft until I get data review

I'll probably want a quick glean eyes on this as well to make sure it's OK to add the new metrics.yaml file

@tarikeshaq
Copy link
Contributor Author

Data review request in #11635

@tarikeshaq tarikeshaq marked this pull request as ready for review August 23, 2022 21:31
@lmarceau lmarceau changed the title Adds metrics to track number of history visits Add FXIOS-4785 [v106] Adds metrics to track number of history visits Aug 25, 2022
@lmarceau
Copy link
Contributor

Build is green here
Screen Shot 2022-08-25 at 1 25 33 PM

@lmarceau lmarceau requested a review from nbhasin2 August 25, 2022 17:25
@tarikeshaq
Copy link
Contributor Author

@nbhasin2 I think this is ready for review, can you think of anything going wrong if we run a query like this? it's asynchronous and runs only once on initialization - I couldn't find another easy spot to collect this telemetry 😕

@tarikeshaq
Copy link
Contributor Author

I also want to cc @travis79 here - No need for you to take time to review the swift changes, but I wanted to make sure that adding an additional metrics.yaml like was done here is OK and that telemetry will be gathered properly

@nbhasin2
Copy link
Contributor

I am going to close and re-open the issue as BR is being weird for this PR

@nbhasin2 nbhasin2 closed this Aug 29, 2022
@nbhasin2 nbhasin2 reopened this Aug 29, 2022
@@ -157,6 +169,24 @@ open class SQLiteHistory {
let args: Args = []
return db.runQueryConcurrently(sql, args: args, factory: SQLiteHistory.iconHistoryColumnFactory)
}

public func countVisits(callback: @escaping (Int?) -> Void) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@tarikeshaq is this a method we plan on keeping for long or the idea is to get rid of it once you have the required data?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The plan is to keep the data for long so we can monitor the sizes of databases and compare this implementation and the application-services one. But we will be getting rid of this method when we swap to using application services history

That said, also with the application services history we will want to keep track of the number of visits, but that will probably happen in Rust as opposed to here in the app

Copy link
Contributor

Choose a reason for hiding this comment

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

@tarikeshaq good to merge, let me know if you have proper permission

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nbhasin2 thanks a ton!!! unfortunely I don't :( Is there a way I can get the permission to land a PR once it's approved?

Copy link
Contributor

Choose a reason for hiding this comment

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

Merged!!

@nbhasin2 nbhasin2 merged commit c3396d5 into mozilla-mobile:main Aug 29, 2022
@tarikeshaq tarikeshaq deleted the adds-places-db-metrics branch August 29, 2022 21:54
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.

3 participants