Skip to content

feat(volo-http): add CommonStats and ServerStats struct to record lifecycle timings#649

Merged
Joshuahoky merged 8 commits intocloudwego:mainfrom
Joshuahoky:feat/http_stats
Apr 17, 2026
Merged

feat(volo-http): add CommonStats and ServerStats struct to record lifecycle timings#649
Joshuahoky merged 8 commits intocloudwego:mainfrom
Joshuahoky:feat/http_stats

Conversation

@Joshuahoky
Copy link
Copy Markdown
Collaborator

@Joshuahoky Joshuahoky commented Mar 23, 2026

Motivation

Volo-http currently lacks visibility into key HTTP lifecycle timings, such as:

  • Time to read request headers and body
  • Time spent handling the request
  • Time to write the response body

Solution

Added ServerStats in volo-http/src/context/server.rs to store timestamps for:

  • request header read start/finish
  • request body read start/finish
  • handler execution start/finish
  • response body write start/finish

Also instrumented the request handling flow to populate the ServerHandleStart / Finish fields of ServerStats

@Joshuahoky Joshuahoky requested review from a team as code owners March 23, 2026 05:44
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.84%. Comparing base (c971091) to head (efdf473).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #649   +/-   ##
=======================================
  Coverage   44.84%   44.84%           
=======================================
  Files         162      162           
  Lines       20078    20081    +3     
=======================================
+ Hits         9003     9006    +3     
  Misses      11075    11075           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

shenyj3
shenyj3 previously approved these changes Mar 23, 2026
@Joshuahoky Joshuahoky changed the title feat(volo-http): add CommonStats struct feat(volo-http): add CommonStats and ServerStats struct to record lifecycle timings Mar 30, 2026
Comment thread volo-http/src/body.rs Outdated
Comment thread volo-http/src/server/mod.rs Outdated
Comment thread volo-http/src/server/mod.rs Outdated
shenyj3
shenyj3 previously approved these changes Apr 16, 2026
@Joshuahoky Joshuahoky merged commit d7acebc into cloudwego:main Apr 17, 2026
14 checks passed
@Joshuahoky Joshuahoky deleted the feat/http_stats branch April 17, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants