winsiderss/systeminformer

Average values in most graphs

Opened this issue · 0 comments

Description of the feature, modification, idea or suggestion

In System Panel most graphs show some rapidly changing values.
CPU load, Disk writes, Network data, IO - these all change sporadically and by a large amount.
This fact makes these graphs practically unusable.
The only way to read these graphs with any use is to squint and imagine some average line. Well, I propose to draw that line directly on graphs themselves.

screenshot 2084539172

If we expand the idea, there is a place to not one, but a few average values for most graphs.

In some cases it is useful to see short-term changes. For instance, an operation in a program that lasts for 3-5 seconds and uses 20% of CPU. To see its effects, we need fast average. But if we need to see long-term changes in chaotic load scenario, it is better to have more long-term average.

Today we have "refresh interval" option, but it does not make graphs any smoother, it just changes their update frequency. Ideally, every graph should update fastly, but would have an option to draw as long average as needed and an option to move slower, for longer timeframes.

So, my proposition is: implement tunable averages. Ideally, the user will have a choice of coarseness of average graphs.

As to how implement this, i haven't any silver bullet. If I'd do that, I'd use cheapest for CPU method that looks like this.

  1. Upon arrival of every new raw datapoint (let's call it X0), calculate new averaged datapoint (X1) using X0 and previous value of X1 (let's call previous value X1p):
    X1 = X1p * 0.9 + X0 * 0.1

  2. After we have X1, calculate new even more averaged datapoint (X2) using X1 and previous value of X2 (let's call previous value X2p):
    X2 = X2p * 0.9 + X1 * 0.1

  3. By analogy, calculate as much as needed next level averages:
    X3 = X3p * 0.9 + X2 * 0.1
    X4 = X4p * 0.9 + X3 * 0.1
    and so on.

  4. Allow user to choose wich data will be used to draw graphs. Depending on ones need, each user will choose his level of averaging.

  5. Coefficient can be changed as well. Instead of using (0.9, 0.1), we can use (0.8, 0.2) or even (0.99, 0.01). That will change differece beetween averaging steps, but principle remains: the more steps, the smoother. The only constraint is that these coefficients have to add to 1.

Whis way we can cheaply have any level of averaging with simple arithmetics without using lot of historical data. We can calculate many levels of these averages every time, but store only last value to preserve memory. That way user will be able to switch to a graph with needed averaging and have an accurate starting average value, and there is no need to store large arrays of historical data or make intense computations.