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 Aug 7, 2020
@auto-assign auto-assign bot requested a review from mdboom Aug 7, 2020
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 Aug 7, 2020
Dexterp37
Dexterp37 previously approved these changes Aug 7, 2020
Copy link
Contributor

@Dexterp37 Dexterp37 left a comment

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

Dexterp37 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?

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
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 Aug 19, 2020
@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

LGTM

@badboy badboy force-pushed the glean-database-size branch 2 times, most recently from 6c8faaa to e560ae7 Compare Aug 20, 2020
badboy added 2 commits Aug 26, 2020
This avoids the need to deal with an "overdue" metrics ping on start.
@badboy badboy merged commit e5c6625 into main Aug 26, 2020
27 of 28 checks passed
@badboy badboy deleted the glean-database-size branch Aug 26, 2020
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.

None yet

4 participants