Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Display PM and WS in MB instead of KB#2927

Merged
lzybkr merged 1 commit into
PowerShell:masterPowerShell/PowerShell:masterfrom
faheel:kilo-to-megaCopy head branch name to clipboard
Dec 29, 2016
Merged

Display PM and WS in MB instead of KB#2927
lzybkr merged 1 commit into
PowerShell:masterPowerShell/PowerShell:masterfrom
faheel:kilo-to-megaCopy head branch name to clipboard

Conversation

@faheel

@faheel faheel commented Dec 23, 2016

Copy link
Copy Markdown
Contributor

Modify output of Get-Process to display PM and WS in MB instead of KB.
Closes #2910

This is how it looks after the changes:
(Command run: Get-Process | Sort-Object -Descending WS)
image

@msftclas

Copy link
Copy Markdown

Hi @faheel, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, MSBOT;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would use 1mb instead of 1024 * 1024 because PowerShell does not implement constant folding.
I think I would also use :N2 instead of :N3, I don't think we require that much precision and helps avoid exceeding the maximum column width now that we see a . that wasn't there before.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, changing 1024 * 1024 to 1MB would be better. I didn't know that before.
As for the precision, if we use :N2 then for processes which take up 1-9KB of memory, it would be shown as 0.00, whereas using :N3 would show, for example, 0.005, which is the correct value.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suppose seeing 0.00 looks wrong and some might investigate, that extra character is also causing problems - here is an example that I just tested with your changes:

   2663 ...6.016      0.004             11940   0 vmmem
   2655 ...6.016    234.953             12720   0 vmmem

And to me - this is worse - I worry more about processes using a lot of memory than those using little memory.

@faheel faheel Dec 23, 2016

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, that's bad.
Should I change the precision of both PM and WS to 2, or just for PM?
(Width of PM's column is 8, while that of WS is 10. Any thoughts on that?)

@PowerShellTeam PowerShellTeam added the Review - Needed The PR is being reviewed label Dec 23, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should use N2.

A process using 5kb will show .01 because that gets rounded up, and very few processes use less than 5kb.

I also noticed in your screenshot that the CPU is showing 3 places after the decimal on Linux but we only see 2 on Windows. I think it's reasonable to use N2 for CPU to be consistent b/w Windows and Linux.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

@faheel

faheel commented Dec 24, 2016

Copy link
Copy Markdown
Contributor Author

This is how the output looks now on Linux:
image

Modify output of Get-Process to display PM and WS in MB instead of KB

Change 1024*1024 to 1MB

Changed 1024*1024 to 1MB and merged commits

Change precision of CPU time to 2

Display PM,WS in MB. Change precision of PM,WS,CPU to 2
@lzybkr lzybkr merged commit d8b4200 into PowerShell:master Dec 29, 2016
@faheel faheel deleted the kilo-to-mega branch December 29, 2016 19:00
rjmholt pushed a commit to rjmholt/PowerShell that referenced this pull request Jan 9, 2017
Modify output of Get-Process to display PM and WS in MB instead of KB.

Also change precision of CPU time to 2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review - Needed The PR is being reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.