disk-io - add iops and improve match condition #772
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The following two features were added:
get_real_disks()
The iops part was added via the
psutil.disk_io_counters
, which is already used for all the other metrics.I renamed some variables to make it clear what iops and bandwidth is.
Also the naming of some variables with xxx15 was misleading, as the default count is 5.
As for the ability to monitor disks not automatically found via the match argument.
I found myself in the situation that on numerous servers, e.g. ones with zfs, the
get_real_disks()
would not pick up on them as they are not mounted in the typical way. Instead monitorig the raw devices was necessary.In my patch i included the option when the match argument is given, all disks from
psutil.disk_io_counters
will be taken into account including the found real disks. After that the regex match will be applied to the list.This behaviour is there to make the check exactly as it was working before, as with the default there is no match argument.
Only if someone wants to specifiy exactly what disks to monitor, the match argument will include all the disks.