Bug 1378959

Summary: libdm-stats: add python bindings
Product: [Community] LVM and device-mapper Reporter: Bryn M. Reeves <bmr>
Component: lvm2Assignee: Bryn M. Reeves <bmr>
lvm2 sub component: libdevmapper QA Contact: cluster-qe <cluster-qe>
Status: CLOSED WONTFIX Docs Contact:
Severity: medium    
Priority: high CC: agk, heinzm, jbrassow, msnitzer, prajnoha, zkabelac
Version: 2.02.166Flags: rule-engine: lvm-technical-solution?
rule-engine: lvm-test-coverage?
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-07 15:08:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Bryn M. Reeves 2016-09-23 16:05:55 UTC
Description of problem:
Some new dmstats functionality is being developed in python, rather than directly in C:

  https://github.com/bmr-cymru/dmioscope

This would be easier, and more efficient, using direct python bindings for the libdm-stats interface. Currently for e.g., getting counter or metric values involves fork()ing, exec()ing, the actual ioctls to retrieve the data, and then a bunch of useless string and int munging as the data is passed on stdout.

Version-Release number of selected component (if applicable):
2.02.166

How reproducible:
100%

Steps to Reproduce:
1. Launch python and attempt to import a dmstats module:
$ python
Python 2.7.12 (default, Sep  2 2016, 14:46:00) 
[GCC 6.1.1 20160621 (Red Hat 6.1.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dmstats


Actual results:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named dmstats
>>> import libdmstats
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named libdmstats
>>> 

Expected results:
>>> print dmstats.version
1.02.$SOMETHING

Additional info:

GitHub issue to switch dmioscope to a python interface:

  https://github.com/bmr-cymru/dmioscope/issues/2