Skip to content

Print timing for page requests and re-parsing in server mode#1648

Merged
st0012 merged 4 commits intomasterfrom
server-request-timing
Mar 16, 2026
Merged

Print timing for page requests and re-parsing in server mode#1648
st0012 merged 4 commits intomasterfrom
server-request-timing

Conversation

@st0012
Copy link
Member

@st0012 st0012 commented Mar 15, 2026

Summary

  • Silence the stats progress bar in server mode — it uses \r on a tty which collides with the server's own logging
  • Print response time for page requests (not assets or status polls): 200 /RDoc.html (12.3ms)
  • Print re-parse duration with relative paths: Re-parsed lib/rdoc.rb (17.5ms)
Serving documentation at: http://localhost:4000
Press Ctrl+C to stop.

200 /RDoc.html (14.9ms)
Re-parsed lib/rdoc.rb (15.7ms)
200 /RDoc.html (8.5ms)

@matzbot
Copy link
Collaborator

matzbot commented Mar 15, 2026

🚀 Preview deployment available at: https://a66a98bf.rdoc-6cd.pages.dev (commit: be7f567)

@st0012 st0012 force-pushed the server-request-timing branch 2 times, most recently from b511016 to 3eed0e3 Compare March 15, 2026 23:38
@st0012 st0012 marked this pull request as ready for review March 15, 2026 23:40
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

st0012 added 4 commits March 16, 2026 12:20
The stats object created during initial parsing prints a progress bar
with \r on a tty, which collides with the server's own stderr output.
Set verbosity to 0 (quiet) since the server handles its own logging.
Log status, path, and duration for page requests only (not assets or
status polls). Example: 200 /RDoc.html (12.3ms)
Show relative file paths and timing after re-parsing changed files.
Example: Re-parsed lib/rdoc.rb (17.5ms)
The browser may close the connection before the server finishes
writing (e.g. during live-reload navigation). This is harmless,
so rescue it silently instead of printing a noisy thread backtrace.
@st0012 st0012 force-pushed the server-request-timing branch from 3eed0e3 to be7f567 Compare March 16, 2026 12:20
@st0012 st0012 merged commit e4e332f into master Mar 16, 2026
78 checks passed
@st0012 st0012 deleted the server-request-timing branch March 16, 2026 12:38
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.

3 participants