Skip to content

Completable future support for @Timed #2008

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

Merged

Conversation

JoseAlavez
Copy link

When utilizing reactive programming libraries that rely on Futures, @Timed will report the execution time for the CompletionStage creation, but not then it's completed.

This PR is solves this issue, by intercepting CompletionStages return types and stopping the timer once completed normally or exceptionally.

@jkschneider
Copy link
Contributor

Wow, thanks for the improvement @JoseAlavez. Significant first contribution!

@jkschneider jkschneider merged commit c05974a into micrometer-metrics:master Apr 19, 2020
@jkschneider jkschneider added this to the 1.5.0 milestone Apr 19, 2020
@jkschneider jkschneider added the enhancement A general enhancement label Apr 19, 2020
@JoseAlavez JoseAlavez deleted the timer-completable-future branch April 22, 2020 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants