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

[System Info] .SwapPercentUsed shows unrealistic high value #1786

Closed
1 task done
thorstenkampe opened this issue Feb 19, 2022 · 6 comments
Closed
1 task done

[System Info] .SwapPercentUsed shows unrealistic high value #1786

thorstenkampe opened this issue Feb 19, 2022 · 6 comments
Assignees
Labels
🐛 bug Something isn't working 🏝 external The issue isn't with oh-my-posh

Comments

@thorstenkampe
Copy link

thorstenkampe commented Feb 19, 2022

Code of Conduct

  • I agree to follow this project's Code of Conduct

What happened?

  • .SwapPercentUsed shows unrealistic high value off 56% swap usage on Windows.
  • Performance Monitor shows about 3% ("Paging File > %Usage")
  • That's also what (SwapTotal - SwapFree) / SwapTotal shows (values from /proc/meminfo (Cygwin))

additional information:

  • PhysicalPercentUsed value is correct
  • .SwapPercentUsed shows correct value on Linux

Theme

{
    "type": "sysinfo",
    "style": "plain",
    "properties": {
        "precision": 0,
        "template": "{{round .SwapPercentUsed .Precision}}%"
    }
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Version: 7.19.1

Segments:

ConsoleTitle(false) -   0 ms -
sysinfo(true)  -  27 ms - 57%

Run duration: 27.6113ms

Cache path: C:\Users\thorsten\AppData\Local/oh-my-posh

Logs:

2022/02/19 15:51:26 Args duration: 0s, args:
2022/02/19 15:51:26 Args duration: 0s, args:
2022/02/19 15:51:26 Args duration: 0s, args:
2022/02/19 15:51:26 Shell duration: 0s, args:
2022/02/19 15:51:26 debug: Getenv

2022/02/19 15:51:26 Getenv duration: 0s, args: OMP_CACHE_DISABLED
2022/02/19 15:51:26 debug: Pwd
F:\cygwin\home\thorsten\.tmux
2022/02/19 15:51:26 Pwd duration: 0s, args:
2022/02/19 15:51:26 debug: Home
F:\cygwin\home\thorsten
2022/02/19 15:51:26 PathSeperator duration: 0s, args:
2022/02/19 15:51:26 PathSeperator duration: 0s, args:
2022/02/19 15:51:26 PathSeperator duration: 0s, args:
2022/02/19 15:51:26 PathSeperator duration: 0s, args:
2022/02/19 15:51:26 PathSeperator duration: 0s, args:
2022/02/19 15:51:26 PathSeperator duration: 0s, args:
2022/02/19 15:51:26 PathSeperator duration: 0s, args:
2022/02/19 15:51:26 debug: Pwd
F:\cygwin\home\thorsten\.tmux
2022/02/19 15:51:26 Pwd duration: 0s, args:
2022/02/19 15:51:26 debug: Home
F:\cygwin\home\thorsten
2022/02/19 15:51:26 Root duration: 0s, args:
2022/02/19 15:51:26 Shell duration: 0s, args:
2022/02/19 15:51:26 ErrorCode duration: 0s, args:
2022/02/19 15:51:26 IsWsl duration: 0s, args:
2022/02/19 15:51:26 debug: Pwd
F:\cygwin\home\thorsten\.tmux
2022/02/19 15:51:26 Pwd duration: 0s, args:
2022/02/19 15:51:26 debug: Home
F:\cygwin\home\thorsten
2022/02/19 15:51:26 PathSeperator duration: 0s, args:
2022/02/19 15:51:26 PathSeperator duration: 0s, args:
2022/02/19 15:51:26 PathSeperator duration: 0s, args:
2022/02/19 15:51:26 PathSeperator duration: 0s, args:
2022/02/19 15:51:26 PathSeperator duration: 0s, args:
2022/02/19 15:51:26 PathSeperator duration: 0s, args:
2022/02/19 15:51:26 PathSeperator duration: 0s, args:
2022/02/19 15:51:26 User duration: 0s, args:
2022/02/19 15:51:26 Host duration: 0s, args:
2022/02/19 15:51:26 GOOS duration: 0s, args:
2022/02/19 15:51:26 TemplateCache duration: 0s, args:
2022/02/19 15:51:26 debug: Getenv
C:\Users\thorsten\AppData\Local
2022/02/19 15:51:26 Getenv duration: 0s, args: LOCALAPPDATA
2022/02/19 15:51:26 CachePath duration: 498.2µs, args:
@thorstenkampe thorstenkampe added the 🐛 bug Something isn't working label Feb 19, 2022
@JanDeDobbeleer JanDeDobbeleer added the 🏝 external The issue isn't with oh-my-posh label Feb 19, 2022
@JanDeDobbeleer
Copy link
Owner

@thorstenkampe we get that value straight from https://github.com/shirou/gopsutil, can you create an issue there? The value comes from mem.SwapMemory()

@thorstenkampe
Copy link
Author

According to their support matrix ("current status") swap_memory doesn't work on Windows.

@JanDeDobbeleer
Copy link
Owner

there we have it (didn't look into it yet)

@thorstenkampe
Copy link
Author

gopsutil says it's a port of Python's psutil - which would explain a lot: [Windows] Swap used is bigger than swap total

@jayagami
Copy link

jayagami commented May 26, 2022

on windows version, PhysicalPercentUsed shows the precentage of unused CPU, which contrary to the actual result.

Copy link

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues.
If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working 🏝 external The issue isn't with oh-my-posh
Projects
None yet
Development

No branches or pull requests

3 participants