Giter Site home page Giter Site logo

Comments (10)

xxxserxxx avatar xxxserxxx commented on August 20, 2024

Yah, gotop divides the CPU usage by the number of cores to show overall CPU usage which differs from the way htop/top works. I hadn't noticed that descrepency before so thanks for pointing that out. Is one way better than the other? If people want per-core CPU usage then maybe we could add a cli option to allow choosing between the two.

from gotop.

xxxserxxx avatar xxxserxxx commented on August 20, 2024

afaik, it's common that cores go to 100%, CPU goes to 100%*nr of cores. So a process using 150% CPU in a quad-core will, in fact, be using one core at 100% and another at 50% - or any other combination of it.

Good reference: https://unix.stackexchange.com/questions/145247/understanding-cpu-while-running-top-command

from gotop.

xxxserxxx avatar xxxserxxx commented on August 20, 2024

It is common and it's used by top/htop, but other resource monitors use gotop's method too like ksysguard. I think it's mostly preference. I personally prefer displaying overall % CPU and I think the default should stay that way, but if we want to add an option or keybind to switch between the two then that sounds good to me!

from gotop.

xxxserxxx avatar xxxserxxx commented on August 20, 2024

I'd really like to have an option to switch between both ways of showing CPU usage.

from gotop.

xxxserxxx avatar xxxserxxx commented on August 20, 2024

It seems to me there is more discrepancy than can be explained by the above reason.

I have a VMBox with windows inside running on OSX. gotop showed me max 10% on the VirtualBoxVM provess (mostly around 5%). That would be approx 1 core on my 12 core machine. htop easily goes up to 300-500% (3-5 cores).

Any idea what that could be?

Very nice tool none the less! I love it!

from gotop.

xxxserxxx avatar xxxserxxx commented on August 20, 2024

@tehsphinx So assuming htop is correctly reporting that information, that discrepancy sounds like a gotop bug and must have something to do with the way we're gather CPU usage information. I'm not immediately sure what that could be, since we're just running ps, so feel free to create an issue for that. I'd also recommend cross referencing the information given with some other resource monitors like top and ksysguard to make sure it's a gotop error.

from gotop.

xxxserxxx avatar xxxserxxx commented on August 20, 2024

@cjbassi Since this is currently hard to compare (because of the different measuring mentioned in this issue) I'm going wait for the suggested option. Keeping an eye out in the meantime.

from gotop.

xxxserxxx avatar xxxserxxx commented on August 20, 2024

@suroa FYI

from gotop.

xxxserxxx avatar xxxserxxx commented on August 20, 2024

I see two topics in this ticket.

  1. Is gotop's CPU usage correct? There's some indication that it might, in some environments, at least. Correcting this will require building a test, because eyeballing against a different top tool isn't going to cut it.
  2. Provide alternate views for CPU data. I see three possible values:
    1. AVG over all CPU processing power in the machine (already implemented with AVG)
    2. Per-core view. Currently, the labels imply a CPU view when it's really showing cores. This is likely just a label change.
    3. Per-CPU view. This is the sum of the core usage percents per each CPU.

I'm not interested in displaying paradoxical values > 100%. Not only is it a very silly thing, to know how much CPU is really being used, the user still has to do mental math to know what the max value is. Therefore, given:

  • A CPU p
  • Cp, the set of usage percentages, 0-1, of all cores of CPU p
  • |Cp|, the number of cores of CPU p

Then:

2.1 - ∑C/Δt (actually, it should be a rolling average over a time window, so slightly more complex than that)
2.2 - ∀p, ∑Cp
2.3 - ∀p, (∑Cp) / (|Cp|)

So: I'm short-cutting this ticket to the first issue; are the CPU usages reported by gotop correct? The other one, I'll create a feature request for.

from gotop.

dkwo avatar dkwo commented on August 20, 2024

I'd also like to report cpu usage different from htop, and inconsistent whitin gotop itself.
1621005405

from gotop.

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.