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

Update metrics interface to couple metric completion and publish #3803

Merged
merged 2 commits into from
Jul 18, 2023

Conversation

amogh09
Copy link
Contributor

@amogh09 amogh09 commented Jul 13, 2023

Summary

Metrics Entry interface in ecs-agent module has a Done method that marks a metric as completed and returns a function that when called publishes the metric. It is supposed to be used like below.

  entry.Done(err)()

It is too easy to forget the trailing () which leads to metrics not being published. We don't really have a usecase to separate metrics completion and publish, so this PR updates the Done method's signature to not return a function. Instead, the method is suppose to do both - mark the metric as completed and publish it.

Implementation details

  • Update Done method of Entry interface.
  • Update usage and tests.

Testing

Automated tests only.

New tests cover the changes: no

Description for the changelog

Update metrics interface to couple metric completion and publish

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@amogh09 amogh09 marked this pull request as ready for review July 13, 2023 22:39
@amogh09 amogh09 requested a review from a team as a code owner July 13, 2023 22:39
@amogh09 amogh09 merged commit 4e85913 into aws:dev Jul 18, 2023
6 checks passed
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