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

[JetBrains] Show Workspace CPU/Memory resources in control center #12053

Merged

Conversation

andreafalzetti
Copy link
Contributor

@andreafalzetti andreafalzetti commented Aug 10, 2022

Context

Currently, in JetBrains IDE the CPU/Memory usage displayed applies to the whole node, instead of displaying the workspace's specific resources.

Description

With this PR we introduce two additional progress bars at the top displaying:

  • Workspace CPU
  • Workspace Memory

Please note: The Unit used for Memory resource is on purpose "GB" instead of "Mi" like in gitpod-cli, my reasons:

  1. personally I find it shorter and easier to read 0.38GB / 1.55GB instead of 2944Mi/11870Mi
  2. when talking about memory (in general) it's more common to refer to GB
  3. in gitpod.io our memory (especially for XL) can be a large number to read if it's in Mi

I would actually like to propose a separate issue to change it also in gp top but I would like to know if there are any reasons or string objections in favor of the smaller unit. cc @akosyakov @felladrin

Related Issue(s)

Fixes #10580

How to test

  1. Signup to this prev env
  2. Select IntelliJ + Latest Release (Unstable) as your preferred IDE
  3. Start a workspace for https://github.com/gitpod-io/spring-petclinic
  4. Click on the control center and see available resources, notice the additional rows at the top (Workspace CPU/Memory) before the default CPU/Memory

OPTIONAL:

  1. To stress the CPU, run: yes > /dev/null & multiple times, observe the progress bar growing and moving to Warning and Danger.
  2. To get the CPU back to a lower value, run: killall yes
  3. To stress the Memory, run cat /dev/zero | head -c 5G | tail once or twice, and observe the memory progress bar behaving as expected

Screenshot 2022-08-11 at 21 42 39

Screenshot 2022-08-11 at 21 51 25

Release Notes

JetBrains: Display Workspace CPU/Memory usage in Backend Control Center

Documentation

Werft options:

  • /werft with-preview

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-afalz-10580-show-workspace-metrics-in-jb-cont.5 because the annotations in the pull request description changed
(with .werft/ from main)

@andreafalzetti andreafalzetti force-pushed the afalz/10580-show-workspace-metrics-in-jb-control-centre branch from 229bb41 to 9fd020e Compare August 11, 2022 10:54
@roboquat roboquat added size/L and removed size/M labels Aug 11, 2022
@andreafalzetti andreafalzetti force-pushed the afalz/10580-show-workspace-metrics-in-jb-control-centre branch from 9fd020e to 54bdfeb Compare August 11, 2022 18:25
@andreafalzetti andreafalzetti force-pushed the afalz/10580-show-workspace-metrics-in-jb-control-centre branch from 54bdfeb to 63693d6 Compare August 11, 2022 18:52
@andreafalzetti andreafalzetti changed the title [WIP] [JetBrains] Show Workspace CPU/Memory resources in control center [JetBrains] Show Workspace CPU/Memory resources in control center Aug 11, 2022
@andreafalzetti andreafalzetti marked this pull request as ready for review August 11, 2022 19:56
@andreafalzetti andreafalzetti requested a review from a team August 11, 2022 19:56
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

code wise it looks good, but i did not try, i wanted but it was pretty slow, probably someone else already trying :D

/hold
hold just in case if someone wants to try or Andrea wants to address something else

@akosyakov
Copy link
Member

I would actually like to propose a separate issue to change it also in gp top but I would like to know if there are any reasons or string objections in favor of the smaller unit. cc @akosyakov @felladrin

I think it should be aligned with default of standard tools like top or htop.

@andreafalzetti
Copy link
Contributor Author

andreafalzetti commented Aug 12, 2022

I think it should be aligned with default of standard tools like top or htop.

It's an interesting take, to look at htop or top - I had a look as I didn't remember what unit the use; for memory htpp also uses G / GB, while top uses M 😄

Screenshot 2022-08-12 at 10 34 54

@felladrin
Copy link
Contributor

I would actually like to propose a separate issue to change it also in gp top but I would like to know if there are any reasons or string objections in favor of the smaller unit. cc @akosyakov @felladrin

For me, it's also nicer to have it in "GB".

@felladrin
Copy link
Contributor

felladrin commented Aug 12, 2022

ℹ️ I'm reviewing it now.

Copy link
Contributor

@felladrin felladrin left a comment

Choose a reason for hiding this comment

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

Working great! ✅

image

Screenshot 2022-08-12 at 11 56 46

@andreafalzetti
Copy link
Contributor Author

andreafalzetti commented Aug 12, 2022

Thanks @felladrin and @akosyakov 🙌

/unhold

@roboquat roboquat merged commit 4091496 into main Aug 12, 2022
@roboquat roboquat deleted the afalz/10580-show-workspace-metrics-in-jb-control-centre branch August 12, 2022 09:34
@akosyakov
Copy link
Member

For me, it's also nicer to have it in "GB".

let's go with GB then

@roboquat roboquat added deployed: IDE IDE change is running in production deployed Change is completely running in production labels Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ide deployed: IDE IDE change is running in production deployed Change is completely running in production editor: jetbrains release-note size/L team: IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate with JetBrains backend control center
4 participants