bmr-cymru / dmioscope

Device-mapper IO visualisation tools
GNU General Public License v2.0
5 stars 1 forks source link

dmioscope: add dmstats command abstraction #7

Closed bmr-cymru closed 7 years ago

bmr-cymru commented 7 years ago

Add an abstraction to handle dmstats operations, rather than open-coding calls to _get_cmd_output() all over the code.

The operations currently used by dmioscope are:

Provide a DmStats class that when instantiated with a device identifier (name, UUID, maj/min) provides methods to invoke the required operation. Each method should build the appropriate command string, call _get_cmd_output() to obtain the result, and print any necessary message before raising a DmstatsException on error.

bmr-cymru commented 7 years ago

As well as making the code more maintainable and less bug-prone this will also simplify a future conversion to a python-dmstats interface (Issue #2).