Git Product home page Git Product logo

Comments (7)

giampaolo avatar giampaolo commented on June 6, 2024 3

Nice finding! It's kind of shocking that CPU metrics on macOS have been wrong for so long and nobody noticed.

from psutil.

ribalba avatar ribalba commented on June 6, 2024 1

I wrote a blog article about the problem here:

https://www.green-coding.io/blog/cpu-utilization-mac/

from psutil.

ArneTR avatar ArneTR commented on June 6, 2024 1

To be fair, it is unknown exactly in which version of macOS this isse happens and if it also is on all chip.s

@ribalba and I both have M1 machines. Untested on Intel and M2.

We are happy to provide a PR and some tests for macOS that test this feature (Stressing a core and seeing if zeros still exist in output), but I see that this repo currently has no macOS Github Actions runner defined.

If we provide a PR, does this repo have the possiblity to have a macOS Runner running that can test the CPU Utilization?

from psutil.

giampaolo avatar giampaolo commented on June 6, 2024

What does htop or similar tools show? 0.1 is a small interval. Task manager tools usually use 1 sec instead. What happens if you use 1 sec?

from psutil.

ArneTR avatar ArneTR commented on June 6, 2024

htop works fine. You can just let it run with 100ms resolution and the many consecutive "0" values do not occur.

For clarification: These values do occuer always no matter what kind of load we are running. So even if all cores are fully stressed zeros creep in, which is probably due to the used syscall.

We have actually created working code for one our tools. Please find it here: https://github.com/green-coding-solutions/green-metrics-tool/blob/main/metric_providers/cpu/utilization/mach/system/source.c

We are using host_processor_info and not host_statistics.

See also discussion here: green-coding-solutions/green-metrics-tool#330

from psutil.

ArneTR avatar ArneTR commented on June 6, 2024

@ribalba FYI

from psutil.

giampaolo avatar giampaolo commented on June 6, 2024

We currently have CI runners for macOS x86-64 and arm (this one was added yesterday).

from psutil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.