-
-
Notifications
You must be signed in to change notification settings - Fork 525
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
Record session statistics on pn.state.session_info #1615
Conversation
Cool! Will the session info ever expire? If not, won't storing that data lead to ever-increasing memory usage over time? |
d283d75
to
11c8e3c
Compare
This is true, that said it's about 1.6 KB per session so even at 100k sessions that's not a huge amount. What I might suggest is that it keeps only the most recent N sessions where N is configurable. |
Okay, I've now reduced it to 0.6 kB per session and added the |
Codecov Report
@@ Coverage Diff @@
## master #1615 +/- ##
==========================================
- Coverage 85.40% 85.25% -0.15%
==========================================
Files 147 147
Lines 16610 16660 +50
==========================================
+ Hits 14185 14204 +19
- Misses 2425 2456 +31
Continue to review full report at Codecov.
|
Sounds good. It should probably also keep the number of sessions as a global value, so that we can tell how much data has been lost due to reaching the session_history limit. |
Co-authored-by: James A. Bednar <jbednar@users.noreply.github.com>
511a8d5
to
48bd49e
Compare
Stores various information about user sessions on
pn.state.session_info
. Currently this records the following fields per session:started
(float): Timestamp when the session was startedrendered
(float): Timestamp when the session was fully renderedended
(float): Timestamp when the session was closed on the serveruser_agent
(str): A string identifying the user agentAdd tests
Add docs