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

Fix metrics test #87898

Merged
merged 2 commits into from
Jun 22, 2023
Merged

Fix metrics test #87898

merged 2 commits into from
Jun 22, 2023

Conversation

tarekgh
Copy link
Member

@tarekgh tarekgh commented Jun 22, 2023

Address the comment #87873 (review)

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 22, 2023
@ghost ghost assigned tarekgh Jun 22, 2023
@tarekgh tarekgh requested a review from noahfalk June 22, 2023 00:26
@tarekgh tarekgh added area-System.Diagnostics.Metric and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jun 22, 2023
@tarekgh tarekgh added this to the 8.0.0 milestone Jun 22, 2023
Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

👍

int lastMeasurement = 0;
listener.SetMeasurementEventCallback<int>((inst, measurement, tags, state) => lastMeasurement = measurement);
listener.EnableMeasurementEvents(counter, null);
listener.Start();
Copy link
Member

Choose a reason for hiding this comment

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

You also don't need to call Start() if you aren't listening to publish events.

@tarekgh tarekgh merged commit 85a8413 into dotnet:main Jun 22, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jul 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants