Comments (9)
Try to run System::refresh_all
at least once. If it works after this, then it means some values aren't initialized correctly on sysinfo side.
from sysinfo.
I released the new version.
from sysinfo.
Cool, thanks for doing it so quickly :).
from sysinfo.
Code looks correct so that's weird... Taking a look.
from sysinfo.
Just to be sure: can you run process-viewer and htop alongside with the program highlighted to have a comparison please?
(process-viewer
is using sysinfo
so it'll make the bug more obvious and maybe easier for me to track)
from sysinfo.
I've used the example
crate which seems to be working correctly and narrowed it down to total_time
not being measured correctly. Just dumping values in terminal:
let (new, old) = get_raw_times(&self.processors[0]);
println!("New {:?} Old {:?}", new, old);
I get:
New 48856671 Old 48849869
Total time 6802, Use time 4509
In the example
crate, but in our project:
New 48842622 Old 0
Total time 48842624, Use time 4136
Digging deeper to figure out why is that.
from sysinfo.
Tested all scenarios:
- Calling
refresh_all
before eachrefresh_process
producescorrect resultsedit: actually incorrect. - Calling
refresh_all
once on init makes thetotal_time
stuck on the same value for allrefresh_process
calls. - Calling
refresh_all
and then probing the process without callingrefresh_process
produces valuesthat are too largeedit: actually correct.
from sysinfo.
Those are quite weird results... But it means that refresh_all
makes an update needed for refresh_process
. It reduces the possibilities quite a lot. With this, I think I'll be able to fix the issue pretty quickly. Thanks a lot!
from sysinfo.
Cheers, thanks for doing this!
edit FYI: I can reproduce all of that behavior in the example crate.
from sysinfo.
Related Issues (20)
- Sysinfo causing program to crash on m1 mac HOT 2
- Physical memory larger than virtual memory on Windows HOT 4
- global_cpu_info().brand() returning M1 instead of Intel on Intel based Macs HOT 2
- Drop once_cell dependency once MSRV can be bumped to 1.70 HOT 1
- Free memory is wrong on Linux with gcroups v2 HOT 10
- Hot plug support HOT 3
- incorrect process cpu usage? HOT 12
- can not get cpu usage in mac os 14.4 (23E214) HOT 1
- Unable to Retrieve User Groups on Windows HOT 1
- Remove `new_all` methods
- Println not working after refresh_cpu() HOT 3
- Temperatures on Linux unavailable HOT 1
- Is it possible to add volume_serial_number to the disk?
- the process API on macOS can returned non UTF-8 String HOT 8
- Add memory frequency, type, and slot information HOT 1
- Only store CPU usage for global CPU and no other information HOT 1
- Return std::result HOT 4
- Add `serde::Serialize` for all the output types HOT 1
- Process priority/affinity support HOT 1
- OpenCloudOS get cpu_usage fail HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sysinfo.