Skip to content

feat: expose stub_status connection-state atomics via event::connecti…#290

Open
u5surf wants to merge 1 commit into
nginx:mainfrom
u5surf:feat/expose-ngx-stat-stub
Open

feat: expose stub_status connection-state atomics via event::connecti…#290
u5surf wants to merge 1 commit into
nginx:mainfrom
u5surf:feat/expose-ngx-stat-stub

Conversation

@u5surf
Copy link
Copy Markdown

@u5surf u5surf commented May 24, 2026

…on_stats

Proposed changes

Describe the use case and detail of the change. If this PR addresses an issue
on GitHub, make sure to include a link to that issue here in this description
(not in the title of the PR).

We would like to pure rust nginx status module, so we’d like to have a safe accessor for the seven ngx_stat_* globals nginx populates when built with --with-http_stub_status_module.

We can already emits the raw externs once that build flag is set, but we currently have to read them by hand with several unsafe casts; the new event::connection_stats() function returns a ConnectionStats snapshot in one call.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have written my commit messages in the Conventional Commits format.
  • I have read the CONTRIBUTING doc
  • I have added tests (when possible) that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

…on_stats

Add a safe accessor for the seven `ngx_stat_*` globals nginx populates
when built with `--with-http_stub_status_module`.  Bindgen already
emits the raw externs once that build flag is set, but consumers
currently have to read them by hand with several `unsafe` casts; the
new `event::connection_stats()` function returns a `ConnectionStats`
snapshot in one call.

Gated behind `#[cfg(ngx_feature = "stat_stub")]` so nginx builds
without stub_status still link cleanly.

Signed-off-by: Y.Horie <u5.horie@gmail.com>
@u5surf u5surf force-pushed the feat/expose-ngx-stat-stub branch from 5f74c2c to 39e7100 Compare May 24, 2026 22:56
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.

1 participant