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

New --sample option does not seem to work as documented #18

Closed
LuisBlanche opened this issue Dec 20, 2024 · 3 comments
Closed

New --sample option does not seem to work as documented #18

LuisBlanche opened this issue Dec 20, 2024 · 3 comments

Comments

@LuisBlanche
Copy link

Hi @vladkens ,
I am working on testing macmon for codecarbon cf mlco2/codecarbon#731

I have tried to use macmon with the -s option and it does not seem to work

I am on a M1 Macbook with Sequoia , upgraded macmon through brew upgrade macmon

WHAT WORKS :

macmon -V
-> macmon 0.4.2
macmon pipe 

-> {"temp":{"cpu_temp_avg":43.137943,"gpu_temp_avg":41.203922},"memory":{"ram_total":8589934592,"ram_usage":6924812288,"swap_total":5368709120,"swap_usage":4811980800},"ecpu_usage":[1139,0.10109444],"pcpu_usage":[2653,0.084456764],"gpu_usage":[396,0.11018046],"cpu_power":0.17914012,"gpu_power":0.1461393,"ane_power":0.0,"all_power":0.3252794,"sys_power":14.522659,"ram_power":0.0,"gpu_ram_power":0.0}
{"temp":{"cpu_temp_avg":44.217594,"gpu_temp_avg":40.891556}, ...
macmon -i 100
-> Green visual "top style" UX

-> {"temp":{"cpu_temp_avg":43.137943,"gpu_temp_avg":41.203922},"memory":{"ram_total":8589934592,"ram_usage":6924812288,"swap_total":5368709120,"swap_usage":4811980800},"ecpu_usage":[1139,0.10109444],"pcpu_usage":[2653,0.084456764],"gpu_usage":[396,0.11018046],"cpu_power":0.17914012,"gpu_power":0.1461393,"ane_power":0.0,"all_power":0.3252794,"sys_power":14.522659,"ram_power":0.0,"gpu_ram_power":0.0}
{"temp":{"cpu_temp_avg":44.217594,"gpu_temp_avg":40.891556}, ... STOPS AFTER 10 SAMPLES 

WHAT DOES NOT WORK :

using macmon pipe with both args :

macmon pipe -s 10 -i 500 | jq

-> error: unexpected argument '-i' found

-> Usage: macmon pipe [OPTIONS]

-> For more information, try '--help'.

using vanilla macmon with -s or --samples does not work

macmon -s 10

-> error: unexpected argument '-s' found

-> Usage: macmon [OPTIONS] [COMMAND]

-> For more information, try '--help'.

using macmon pipe with --interval doesn't work either :

macmon pipe -i 100
-> error: unexpected argument '-i' found

-> Usage: macmon pipe [OPTIONS]

-> For more information, try '--help'.

I think i've covered it , let me know if i can help !

@LuisBlanche
Copy link
Author

EDIT : actually it seems that if I revert the order of args ie :
macmon -i 10 pipe -s 10 i get the intended result (ie 10 samples every 10 ms)

@vladkens
Copy link
Owner

Hi, @LuisBlanche.

-i is argument of macmon itself, and -s is argument of pipe subcommand.
So yes, correct syntax is macmon -i 10 pipe -s 10 and don't match the readme.
I will add fallback for -i to pipe command.

Also -i have minimal value as 100ms.

@vladkens
Copy link
Owner

@LuisBlanche

Released this fix in v0.5.0

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

No branches or pull requests

2 participants