Code Monkey home page Code Monkey logo

Comments (8)

GuillaumeGomez avatar GuillaumeGomez commented on June 9, 2024

Thanks for opening the issue! I'll check it evening.

from sysinfo.

Oreilles avatar Oreilles commented on June 9, 2024

It was a mistake of mine, sorry about that..!

from sysinfo.

GuillaumeGomez avatar GuillaumeGomez commented on June 9, 2024

You forgot to update before getting the temperature or something else? In any case, if that comes from a misunderstanding, it means that documentation could be improved so I'm quite interested!

from sysinfo.

Oreilles avatar Oreilles commented on June 9, 2024

That's exactly what happened yes - I just copy/pasted the code sample from the README, which happen to have sys.refresh_all(); at the end, which made me assume that that would be run by default at class initialization. That might be a mistake as the code sample from docs.rs has it placed just after initialization - and as I saw some things does not work without it being placed there ?

from sysinfo.

GuillaumeGomez avatar GuillaumeGomez commented on June 9, 2024

Well, some information like CPU usage needs at least two updates (otherwise you can't compute a mean). Same goes for components: the initialization gets their list but not their information. I need to precise it at some point.

from sysinfo.

Oreilles avatar Oreilles commented on June 9, 2024

Maybe the two lines :

// First we update all information of our system struct.
system.refresh_all();

Should be placed just after let mut sys = System::new(); in the code sample from README, much like the one from docs.rs

from sysinfo.

GuillaumeGomez avatar GuillaumeGomez commented on June 9, 2024

Do you want to send a PR? :)

from sysinfo.

Oreilles avatar Oreilles commented on June 9, 2024

Haha, I leave that to you as I don't know rust nor your library enough.
There's another problem(?) I have: almost half of process found have Unknown(0) as a status. 0 might not be that unknown - although I couldn't tell what it could refer to.

from sysinfo.

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.