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 1694770 - Implement the timespan metric type #253

Merged
merged 6 commits into from
Apr 28, 2021

Conversation

brizental
Copy link
Contributor

No description provided.

@brizental brizental requested a review from Dexterp37 April 26, 2021 14:24
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.

Looks good overall, there's a few nits and a CHANGELOG entry should be added as well. Does the glean_parser already produce valid code to use this?

glean/src/core/utils.ts Show resolved Hide resolved
glean/src/core/metrics/types/timespan.ts Show resolved Hide resolved
glean/src/core/metrics/types/timespan.ts Outdated Show resolved Hide resolved
@brizental
Copy link
Contributor Author

Does the glean_parser already produce valid code to use this?

Yes, we were only missing labeled. Unless we introduce a metric type that the Glean SDK does not also support, we are good.

@brizental brizental requested a review from Dexterp37 April 27, 2021 15:01
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.

r+

* No error is recorded if no `start()` was called.
*/
cancel(): void {
Context.dispatcher.launch(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why wasn't this failing our tests? did you end up finding out?

Copy link
Contributor Author

@brizental brizental Apr 28, 2021

Choose a reason for hiding this comment

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

Dispatched or not, start and cancel when called in sequence seem to run one after the other. Probably because neither have any actual await inside. I tried to make the tests fail, but they never did.

Only when I launch some setTimeout's in between calling them do they fail, but I did not commit such a test because I thought it would be confusing.

@brizental brizental merged commit 26ddc6e into mozilla:main Apr 28, 2021
@brizental brizental deleted the 1694770-timespan branch April 28, 2021 11:32
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