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

Show live CPU and memory usage of user session backend #414

Merged
merged 2 commits into from
Oct 10, 2023

Conversation

anders-kiaer
Copy link
Collaborator

@anders-kiaer anders-kiaer commented Oct 10, 2023

Related to #362.

  • Replaced the "⭐ GitHub" in the menu with CPU/memory metrics of the user session backend.
  • Uses psutils in backend to report container stats (psutil inside docker container reports host stats giampaolo/psutil#1011 (comment)).
  • Uses react-query on frontend to fetch container status every two seconds. React-query refetches only when user has the browser tab focused. Locking the screen or going away from the tab stopes the refetching, and therefore also starts the countdown for stopping the user session backend.

image

@anders-kiaer anders-kiaer marked this pull request as ready for review October 10, 2023 10:01
@anders-kiaer anders-kiaer self-assigned this Oct 10, 2023
Copy link
Collaborator

@rubenthoms rubenthoms left a comment

Choose a reason for hiding this comment

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

LGTM! A few comments.

backend/src/backend/user_session/routers/general.py Outdated Show resolved Hide resolved
backend/src/backend/user_session/routers/general.py Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the future, I think this is not the perfect place for that info. I think as soon as we have a logging system and even some other data, I would vote for implementing a slim status bar at the bottom of the page. For now, this is good.

@anders-kiaer anders-kiaer merged commit d643050 into main Oct 10, 2023
6 checks passed
@anders-kiaer anders-kiaer deleted the cpumemoryusage branch October 10, 2023 11:41
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.

2 participants