dankamongmen / growlight

notcurses block device manager / system installation tool
https://nick-black.com/dankwiki/index.php/Growlight
GNU General Public License v3.0
85 stars 12 forks source link

Retrieve disk activity levels at 1Hz #18

Closed dankamongmen closed 5 years ago

dankamongmen commented 5 years ago

To implement #5 , we'll need get kernel disk statistics. I say we use /proc/diskstats rather than the /sysfs entries, both to keep the number of filesystem operations to a minimum O(1) vs O(N) and to be able to break them down by partition, which I don't think sysfs provides. We have to lex some crap either way. sysfs does provide more detailed stats, IIRC.

https://www.kernel.org/doc/Documentation/block/stat.txt https://www.kernel.org/doc/Documentation/iostats.txt

dankamongmen commented 5 years ago

I think this ought be a core part of growlight, even though it's not being treated as such in growlight-readline (#20). Advantages include:

disadvantages:

dankamongmen commented 5 years ago

oooh, another advantage: we could show a history of usage in the detail command

dankamongmen commented 5 years ago

We're collecting the stats now, though we're not yet tying them into the struct device elements.

dankamongmen commented 5 years ago

Alright, we're now keeping track of a single timespan of disk stats, running them from a single place, and storing them with the respective devices, as is sane. I think this is done!