r-lib / ps

R package to query, list, manipulate system processes
https://ps.r-lib.org/
Other
72 stars 18 forks source link

ps_system_memory()$percent is differently scaled on Windows and Linux #131

Closed francisbarton closed 1 year ago

francisbarton commented 1 year ago

If I run ps::ps_system_memory() on Linux, I get a number between 0 and 100 returned for the $percent element, eg 82.02327. Running the same command on Windows, I get a number between 0 and 1 for $percent, eg 0.8202327.

I think the output should be consistent - either way. Or should it be up to the user to amend their script to account for which OS it is being run on?

gaborcsardi commented 1 year ago

You are right, this is not great. Would you like to submit a PR to fix the number on windows? (No pressure.)

francisbarton commented 1 year ago

Yes, happy to try. I'll have a look at the code soon.