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

Bug 1656589 - Track the database size on initialization #1141

Merged
merged 4 commits into from
Aug 26, 2020

Conversation

badboy
Copy link
Member

@badboy badboy commented Aug 7, 2020

No description provided.

@badboy badboy added the needs:data-review PR is awaiting a data review label Aug 7, 2020
@badboy badboy requested a review from Dexterp37 August 7, 2020 08:46
@auto-assign auto-assign bot requested a review from mdboom August 7, 2020 08:48
glean-core/src/internal_metrics.rs Show resolved Hide resolved
glean-core/metrics.yaml Outdated Show resolved Hide resolved
@badboy badboy requested a review from Dexterp37 August 7, 2020 11:07
@badboy badboy force-pushed the glean-database-size branch from 97c12e8 to 6ebab93 Compare August 7, 2020 11:07
Dexterp37
Dexterp37 previously approved these changes Aug 7, 2020
Copy link
Contributor

@Dexterp37 Dexterp37 left a comment

Choose a reason for hiding this comment

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

This LGTM, but how does it make the tests on Android fail!?

@badboy badboy removed the needs:data-review PR is awaiting a data review label Aug 12, 2020
@badboy
Copy link
Member Author

badboy commented Aug 12, 2020

This LGTM, but how does it make the tests on Android fail!?

I think I know why: we now have a metric available for each metrics ping.
Previously our tests relied on it being empty most of the time and thus it not getting sent.
Now that it has a never-cleared metric it will always get sent.

That brings up the questions:

  • Ping or Application lifetime? Ping means we only get it once, I guess that is still enough for analysis, given it doesn't change for the application lifetime anyway?
  • Is the metrics ping even the right place for it?

@badboy
Copy link
Member Author

badboy commented Aug 12, 2020

Choosing a lifetime=user would indeed make tests pass.

It doesn't, I compiled the wrong code.

glean-core/metrics.yaml Outdated Show resolved Hide resolved
glean-core/src/internal_metrics.rs Outdated Show resolved Hide resolved
@Dexterp37
Copy link
Contributor

This LGTM, but how does it make the tests on Android fail!?

I think I know why: we now have a metric available for each metrics ping.
Previously our tests relied on it being empty most of the time and thus it not getting sent.
Now that it has a never-cleared metric it will always get sent.

That brings up the questions:

* Ping or Application lifetime? Ping means we only get it once, I guess that is still enough for analysis, given it doesn't change for the application lifetime anyway?

I think Ping lifetime is fine. If we restart multiple times before sending a metric ping, we're sending a timing distribution anyway, so we'll record multiple values.

* Is the metrics ping even the right place for it?

Yes, I believe it is, still. We make no guarantee or assumption about this ping not being sent.

@badboy badboy force-pushed the glean-database-size branch from 6ebab93 to 4c73754 Compare August 19, 2020 14:51
@badboy
Copy link
Member Author

badboy commented Aug 19, 2020

I had to resort to sort of a small hack to get tests passing by ignoring the metrics ping (by essentially delaying it). That touches far too many tests to my liking, but it's the unfortunate truth how it all works.

I'd like some review on that. It also means we now always have a metrics ping because we are recording metrics (but in actual applications we might not be the only ones anyway, so probably not a real problem?)

@badboy badboy requested review from mdboom and travis79 August 19, 2020 14:53
@badboy
Copy link
Member Author

badboy commented Aug 19, 2020

Ah! I also think the same has to be done for iOS, which I haven't done yet. I also never ran the tests for iOS yet.

Copy link
Member

@travis79 travis79 left a comment

Choose a reason for hiding this comment

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

LGTM

@badboy badboy force-pushed the glean-database-size branch 2 times, most recently from 6c8faaa to e560ae7 Compare August 20, 2020 15:23
badboy added 2 commits August 26, 2020 13:27
This avoids the need to deal with an "overdue" metrics ping on start.
@badboy badboy force-pushed the glean-database-size branch from e560ae7 to d956dbd Compare August 26, 2020 11:29
@badboy badboy merged commit e5c6625 into main Aug 26, 2020
@badboy badboy deleted the glean-database-size branch August 26, 2020 14:08
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.

4 participants