Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

per-cpu usage cannot display legend for all threads with high CPU thread count #76

Open
rolinh opened this issue Apr 27, 2020 · 4 comments

Comments

@rolinh
Copy link

rolinh commented Apr 27, 2020

Required information:

  • ytop version (ytop -V): ytop 0.6.0
  • The output of uname -a: Linux 5.6.7-arch1-1 #1 SMP PREEMPT Thu, 23 Apr 2020 09:13:56 +0000 x86_64 GNU/Linux

When launching ytop -p, the legend is truncated when a large number of CPU threads is available. The screenshot below was taken on a 2560x1440 display resolution. Out of the 32 CPU threads, 4 are missing (and it is obviously worse when the terminal window is smaller).

image

In minimal mode, one can see the legend for all CPU threads.

image

What about displaying the legend at the bottom instead? It could then use the entire width and a new column would be created when necessary?

EDIT: as of note, there are also only 8 different colors to draw each line so they get re-used 4 times each (but I think that adding more colors would only make the graph look like more colorful fireworks rather than make it more readable).

@mouse07410
Copy link

mouse07410 commented Aug 1, 2020

I have a similar problem: ytop on iMac Pro available CPUs are not shown at all, unless I specify -p flag:

Screen Shot 2020-07-31 at 22 29 51

This is from ytop -pas on the same machine - observe that the temperature is still off into negative:

ytop_better-temp_off

There seems to be a problem with sysinfo?

$ cargo run
    Updating crates.io index
   Compiling autocfg v1.0.0
   Compiling maybe-uninit v2.0.0
   Compiling cfg-if v0.1.10
   Compiling lazy_static v1.4.0
   Compiling libc v0.2.74
   Compiling rayon-core v1.7.1
   Compiling scopeguard v1.1.0
   Compiling doc-comment v0.3.3
   Compiling sysinfo v0.14.15
   Compiling either v1.5.3
   Compiling once_cell v1.4.0
   Compiling crossbeam-utils v0.7.2
   Compiling memoffset v0.5.5
   Compiling crossbeam-epoch v0.8.2
   Compiling rayon v1.3.1
   Compiling num_cpus v1.13.0
   Compiling crossbeam-queue v0.2.3
   Compiling crossbeam-deque v0.7.3
   Compiling rust-temperature v0.1.0 (/Users/ur20980/src/rust-temperature)
    Finished dev [unoptimized + debuginfo] target(s) in 11.33s
     Running `target/debug/rust-temperature`
Components: 2
CPU: -37.453125
CPU Proximity: 41.4375
$ port installed sysinfo
None of the specified ports are installed.
$ vi Cargo.toml 
$ cargo run
    Updating crates.io index
  Downloaded sysinfo v0.15.0
  Downloaded 1 crate (77.9 KB) in 0.48s
   Compiling sysinfo v0.15.0
   Compiling rust-temperature v0.1.0 (/Users/ur20980/src/rust-temperature)
    Finished dev [unoptimized + debuginfo] target(s) in 3.08s
     Running `target/debug/rust-temperature`
Components: 2
CPU: -44.75
CPU Proximity: 40.75
$ 

sys info-0.13.4 performs correctly. 0.14.* fails.

@CosmicHorrorDev
Copy link

Just a few notes:

  • In the first picture ytop only automatically shows each cpu thread if you have 8 or less, otherwise it shows an average, so that's expected behavior.
  • Can you check if you have swap enabled to see if it should be showing up in the graph?
  • If you suspect sysinfo is the cause of the wrong cpu temp since it worked in a previous version and doesn't now then you should open an issue with them to address this.

@mouse07410
Copy link

ytop only automatically shows each cpu thread if you have 8 or less...

Understood, thanks. Then it behaves correctly.

Can you check if you have swap enabled to see if it should be showing up in the graph?

Interesting... It appears that swap is not enabled:

. . . . .
Pageins:                               30119675.
Pageouts:                                     0.
Swapins:                                      0.
Swapouts:                                     0.

I'm learning new things about my machines. ;-)

If you suspect sysinfo is the cause of the wrong cpu temp since it worked in a previous version and doesn't now then you should open an issue with them to address this.

Just did it: GuillaumeGomez/sysinfo#357

In the meanwhile - is there a way to tell cargo to install ytop using sysinfo-0.13.4? I install from crates.io via cargo install ytop. Thanks!

@CosmicHorrorDev
Copy link

In the meanwhile - is there a way to tell cargo to install ytop using sysinfo-0.13.4 ?

AFAIK not easily as 0.14.1 is specified in Cargo.toml and cargo will be obeying the Cargo.toml file. From a quick peek at the project history it looks like version 0.14.1 was the one picked when it got added, so your best bet would be to:

  1. Clone the repo locally
  2. Edit the sysinfo version in Cargo.toml and install from there
  3. Hope that everything still works on the older sysinfo version

Or you can try waiting for a fix to get pushed through in sysinfo and a new version to be released.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants