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

Websocket server metrics endpoint #49

Merged
merged 6 commits into from
Aug 13, 2020

Conversation

AlejoAsd
Copy link
Contributor

This PR adds a /metrics HTTP endpoint to the websocket server using libwebsockets HTTP capabilities.

The /metrics endpoint currently returns the number of active websocket connections. It will be used to monitor and scale websocket server deployments.

Note: No new lws protocols were added to support HTTP. Instead, the LWS_CALLBACK_HTTP event is first handled by rootCallback and delegated to httpCallback. It was implemented this way because HTTP requests do not provide protocol names and end up defaulting to rootCallback.

@AlejoAsd AlejoAsd requested a review from nkoenig as a code owner August 11, 2020 03:08
@AlejoAsd AlejoAsd force-pushed the websocket_server_metrics branch from 626b896 to d36afa0 Compare August 11, 2020 03:10
@AlejoAsd AlejoAsd changed the title Websocket server metrics endpoint. Websocket server metrics endpoint\ Aug 11, 2020
@AlejoAsd AlejoAsd changed the title Websocket server metrics endpoint\ Websocket server metrics endpoint Aug 11, 2020
Signed-off-by: Alejo Carballude <[email protected]>
@AlejoAsd AlejoAsd force-pushed the websocket_server_metrics branch from 6ca4214 to 12cec70 Compare August 11, 2020 14:32
plugins/websocket_server/WebsocketServer.cc Outdated Show resolved Hide resolved
plugins/websocket_server/WebsocketServer.cc Show resolved Hide resolved
plugins/websocket_server/WebsocketServer.cc Show resolved Hide resolved
plugins/websocket_server/WebsocketServer.cc Outdated Show resolved Hide resolved
plugins/websocket_server/WebsocketServer.cc Show resolved Hide resolved
plugins/websocket_server/WebsocketServer.cc Outdated Show resolved Hide resolved
plugins/websocket_server/WebsocketServer.cc Outdated Show resolved Hide resolved
plugins/websocket_server/WebsocketServer.cc Outdated Show resolved Hide resolved
@chapulina chapulina added the 📜 blueprint Ignition Blueprint label Aug 11, 2020
Signed-off-by: Alejo Carballude <[email protected]>
@AlejoAsd AlejoAsd requested a review from nkoenig August 12, 2020 13:37
Copy link
Contributor

@nkoenig nkoenig left a comment

Choose a reason for hiding this comment

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

Works well.

@nkoenig nkoenig merged commit 823e6c6 into gazebosim:ign-launch1 Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📜 blueprint Ignition Blueprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants