Git Product home page Git Product logo

Comments (3)

giampaolo avatar giampaolo commented on June 22, 2024

You should try to see if sensors command has the same behavior (I suspect yes).

from psutil.

f18m avatar f18m commented on June 22, 2024

Thanks @giampaolo for very fast answer.
I have been running 'watch -n1 sensors' just now and indeed I see some "crazy" sample appearing every now and then.
I guess that sounds like a kernel(module) bug?

Would it make sense to build some 'moving average' filtering on psutil side to handle such buggy sensors?

from psutil.

giampaolo avatar giampaolo commented on June 22, 2024

Nope. We should always return what the kernel gives us.

To be honest, there is one exception in psutil: net_io_counters() and disk_io_counters(). On long running systems the kernel may wrap the returned numbers and restart from 0, in which case psutil will adjust them so they never go backwards:

psutil/psutil/__init__.py

Lines 2072 to 2075 in 3c518a3

If *nowrap* is True it detects and adjust the numbers which overflow
and wrap (restart from 0) and add "old value" to "new value" so that
the returned numbers will always be increasing or remain the same,
but never decrease.

Calculating a moving average is something different though.

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.