3

I'd like to show read/write speeds in the panel as numbers.

I know that it is possible to show a graph using System Load Indicator, and that it is possible to show numbers using System Monitor Indicator. I also found that there used to be a bug which showed hard disk read/write speed as a number on the panel here. Nevertheless, I cannot figure out how to replicate such functionality.

In reference to System Monitor Indicator, I know that I can add custom commands to it. However, I cannot find a command which can be added which works. Ideally it's possible and I've overlooked it.

Byte Commander
  • 107,489
  • 1
    Very interesting question. I'll work on it, will see what I can come up with. Shouldn't be too difficult to make indicator like that. Check back in a day or two – Sergiy Kolodyazhnyy Dec 15 '16 at 20:35
  • In case of multiple disks, which one? – Jacob Vlijm Dec 15 '16 at 20:47
  • I was thinking of an aggregate measure originally, but depending on what @Serg – shibambu Dec 15 '16 at 20:54
  • (cont'd since apparently I can't edit my previous comment) comes up with, perhaps individual data could also be displayed. – shibambu Dec 15 '16 at 20:55
  • @joshYarnspinner what do you mean by "aggregate measure" ? Sorry, English ain't my first language – Sergiy Kolodyazhnyy Dec 15 '16 at 20:59
  • It's the total write speed. If I had 5 disks, each at 100MB/s, I'd want 500MB/s. – shibambu Dec 15 '16 at 21:18
  • Hi there ! A small update on the work in progress : http://imgur.com/a/wwnUB I managed to get the usage data, display the totals in the panel i human-readable form, and also per/device data in the drop down menu ( which isn't in the screenshot, though). I'll polish up the indicator and post it within next 48-ish hours. We have a snow storm over here , so timing shouldn't be a problem. Let me know if you have any particular requests or "in-flight adjustments" – Sergiy Kolodyazhnyy Dec 17 '16 at 11:24
  • That's perfect - just what I wanted. – shibambu Dec 17 '16 at 12:23

1 Answers1

5

Introduction

As indicated in the comments, I've written a custom indicator to display disk i/o usage. It allows displaying total usage in the panel as well as per-device information in the indicator menu. It provides information on i/o usage of only those devices that are mounted and adapts its information when devices are mounted/unmounted. Panel text can be turned on-off, and basic settings can be controlled via ~/.diskstat_indicator.json file. enter image description here

Usage

The indicator can be launched as any other application by calling it via Unity Dash or directly via command-line (diskstat_indicator command). To launch the indicator upon login, one can place copy of /usr/share/applications/diskstat_indicator.desktop file into ~/.config/autostart/ directory.

Since the ever changing speed of reads and writes total affects the length of text in the panel, it will constantly move other indicators back and forth. This can get annoying really fast, which is why I've added an option into the menu that will disable/enable panel text. The total information still can be seen via the menu. Notice that the information field is a non-selectable menu item simply because there's no action associated with that menu item. It might have something in future, but the primary function of this indicator is to display data, rather than serve as action-oriented indicator.

Sample ~/.diskstat_indicator.json :

{
    "show_panel_text": true,
    "timeout": 1.5
}

Installation

The indicator can be obtained from my personal PPA. Use the following steps to add PPA and install the indicator:

  1. sudo add-apt-repository ppa:1047481448-2/sergkolo
  2. sudo apt-get update
  3. sudo apt-get install diskstat-indicator

The source code is also available on the project's GitHub repository.

Technical details, discussion, and further steps

The way indicator works is simple: it reads /proc/diskstats file , cross checks the devices with /proc/mounts, and extracts information only for those devices that are mentioned in the /proc/mounts file. This is essentially same behavior as iotop or iostat programs. In my tests, the data generally agrees with iotop, although with slight variation.

It should be mentioned that this is by no means a high-quality tool. It is meant to only get quick idea of what is happening with disk i/o ; there user should be able to take a look and say "OK, the i/o usage is quite high, so there's clearly something going on". Every user has different workflow, so it may or may not be suitable for power users. If you need more detailed information, such as per process i/o activity, then probably you want iotop software package.

Other indicators that you might find useful in combination with this tool is the Udisks Indicator, which can be used for observing disk space usage and mounting/unmounting partitions.

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497