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

proposal: net/http: add accessor for number of listeners and connections #36538

Open
erwiese opened this issue Jan 13, 2020 · 2 comments
Open

proposal: net/http: add accessor for number of listeners and connections #36538

erwiese opened this issue Jan 13, 2020 · 2 comments

Comments

@erwiese
Copy link

@erwiese erwiese commented Jan 13, 2020

Hi,
running a http/server it would be helpfully to know the count of listeners and connections, for monitoring reasons. The server already has the fields listeners and activeConn. What about adding methods like GetCurrentListenersCount and GetActiveConnectionsCount?

@smasher164 smasher164 changed the title http/server: get count of listeners and connections proposal: net/http: add accessor for number of listeners and connections Jan 14, 2020
@gopherbot gopherbot added this to the Proposal milestone Jan 14, 2020
@ianlancetaylor ianlancetaylor added this to Incoming in Proposals Jan 6, 2021
@AlexanderYastrebov
Copy link
Contributor

@AlexanderYastrebov AlexanderYastrebov commented Oct 17, 2021

I think it is possible to track listeners externally before calling Serve and track connections using https://pkg.go.dev/net/http#ConnState callback

@erwiese
Copy link
Author

@erwiese erwiese commented Oct 22, 2021

Yes, but why should I do that work, if the information is already available and only the accessor is missing.

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

No branches or pull requests

4 participants