Skip to content

Conversation

@henrysingleton
Copy link

@henrysingleton henrysingleton commented Feb 1, 2023

Fixes #51 where the power usage key was renamed from package_energy to combined_power in macOS Ventura, resulting in the following error when attempting to run asitop under Monterey:

[3/3] Waiting for first reading...

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/asitop/utils.py", line 18, in parse_powermetrics
    cpu_metrics_dict = parse_cpu_metrics(powermetrics_parse)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/asitop/parsers.py", line 133, in parse_cpu_metrics
    cpu_metric_dict["package_W"] = cpu_metrics["combined_power"]/1000
                                   ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'combined_power'

@emidln-imc
Copy link

Fixes #51

@henrysingleton henrysingleton changed the title fix: restore compatibility with macOS 12 Monterey fix: restore compatibility with macOS 12 Monterey (Fixes #51) Feb 1, 2023
@henrysingleton henrysingleton changed the title fix: restore compatibility with macOS 12 Monterey (Fixes #51) fix: restore compatibility with macOS 12 Monterey Feb 1, 2023
@chrisgervang
Copy link

@tlkh could we please merge in this fix?

@mathdroid
Copy link

bump @tlkh

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

Successfully merging this pull request may close these issues.

KeyError: 'combined_power' on MacOS 12.4/12.6.3 on M1 Max

5 participants