Skip to content

Add metrics for number of active sessions and sessions' durations #890

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

Merged
merged 4 commits into from
Feb 1, 2023

Conversation

adwinwhite
Copy link
Contributor

Added metrics for number of active sessions and sessions' durations based on websockets' connectivity.

And tested them with local Prometheus server.

@adwinwhite
Copy link
Contributor Author

adwinwhite commented Jan 25, 2023

Oh, messed up with previous commit.
Fix it later. Laptop is not available now.

@adwinwhite
Copy link
Contributor Author

Adding query parameter ?websocket=1 to URL will enable WebSocket connection.

Although ?websocket=1 is immediately overwritten after configuration like version/mode/edition is initialized, it will take effect nonetheless.

Copy link
Member

@shepmaster shepmaster left a comment

Choose a reason for hiding this comment

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

Looking reasonable. One relevant question and a bunch of tiny syntax nits.

@adwinwhite adwinwhite force-pushed the ws_metrics branch 2 times, most recently from 31d5834 to 4223699 Compare January 27, 2023 02:48
@adwinwhite
Copy link
Contributor Author

Suggestions applied.

@shepmaster
Copy link
Member

I did a force push with two main changes:

  1. Storing the WebSocket in window to prevent it from being garbage collected. Testing in Safari showed that it previously disconnected almost immediately. Firefox and Chrome didn't appear to be that aggressive.
  2. Code style things (yarn test:lint:fix && yarn test:style:fix)

@shepmaster shepmaster added the CI: approved Allowed access to CI secrets label Feb 1, 2023
@shepmaster shepmaster added CI: approved Allowed access to CI secrets and removed CI: approved Allowed access to CI secrets labels Feb 1, 2023
@shepmaster shepmaster added CI: approved Allowed access to CI secrets and removed CI: approved Allowed access to CI secrets labels Feb 1, 2023
@shepmaster shepmaster merged commit 2429b73 into rust-lang:master Feb 1, 2023
@shepmaster shepmaster added the enhancement Something new the playground could do label Feb 3, 2023
@adwinwhite adwinwhite deleted the ws_metrics branch February 4, 2023 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: approved Allowed access to CI secrets enhancement Something new the playground could do
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants