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

Response.whenSent() only works when called before Response.send() #8875

Closed
alwaysthecritic opened this issue Jun 12, 2024 · 0 comments · Fixed by #8884
Closed

Response.whenSent() only works when called before Response.send() #8875

alwaysthecritic opened this issue Jun 12, 2024 · 0 comments · Fixed by #8884
Assignees

Comments

@alwaysthecritic
Copy link

Environment Details

  • Helidon Version: 4.0.9
  • Helidon SE
  • JDK version: OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode)
  • OS: macOS Sonoma 14.5
  • Docker version (if applicable): N/A

Problem Description

This documentation page on Metrics (https://helidon.io/docs/latest/se/guides/metrics) has a Timer code sample, with respond.send() followed by response.whenSent(), but in my code, if I do it that way around, I get no data recorded in my Timer metric. If I swap the order and call response.whenSent() first, then it works.

So either the documentation that includes such examples needs to be updated, or the code needs to be changed to work either way around. Regardless the Javadoc for the whenSent() method should probably explicitly describe what works (only before, or before/after).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants