We also need to check for /sys/block/*/device
as I explained in the chat. The logic is supposed to be like this.
Well, this logging.info
we could keep but I would prefer if we got rid of f-strings due to #9
We shouldn't use /proc/diskstats
at all because it doesn't contain the information we need. We could use /proc/partitions
if /sys/block
isn't available. But I don't think I have such a…
Good approach. There is a good chance the parser functionality is sufficient for what we need. You can now continue extracting more and more data from it.
We shouldn't log it, just skip it, or we should first test if the file exists or is readable to filter the obvious exceptions.
There is way more information to be obtained from dmidecode. The process of opening and parsing the output would need to be repeated, so is better to extract it.
There are multiple approaches…
I think this is a good start. In the next steps, you can think about how to generalise the approach, so you don't have to copy & paste the glue all the time. And also there are cases where…
notes
I don't see it in the api either: https://github.com/cp6/my-idlers/blob/main/routes/api.php . It probably needs to be implemented. Don't worry about it now, just work on the client.