Hello Bala.FA,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/23201
to review the following change.
Change subject: gluster: Enhancing glusterVolumeStatus verb to include volume stats info.
......................................................................
gluster: Enhancing glusterVolumeStatus verb to include volume stats info.
glusterVolumeStatus verb is enhanced to include volume stats info
along with the existing status information when the statusOption
is set as detail.
Change-Id: Idf978b25fa6c09097fdfbc65937056082c5bff10
Signed-off-by: ndarshan <dnarayan(a)redhat.com>
---
M vdsm/gluster/api.py
1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/23201/1
diff --git a/vdsm/gluster/api.py b/vdsm/gluster/api.py
index 3cc5493..62c7ba9 100644
--- a/vdsm/gluster/api.py
+++ b/vdsm/gluster/api.py
@@ -208,6 +208,16 @@
options=None):
status = self.svdsmProxy.glusterVolumeStatus(volumeName, brick,
statusOption)
+ if statusOption == 'detail':
+ statvfsData = self.svdsmProxy.glusterVolumeStatsInfoGet(volumeName)
+ total = ((statvfsData.f_blocks -
+ (statvfsData.f_bfree - statvfsData.f_bavail)) *
+ statvfsData.f_bsize)
+ free = statvfsData.f_bavail * statvfsData.f_bsize
+ used = total - free
+ status['volumeStatsInfo'] = {'total': str(total),
+ 'free': str(free),
+ 'used': str(used)}
return {'volumeStatus': status}
@exportAsVerb
--
To view, visit
http://gerrit.ovirt.org/23201
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf978b25fa6c09097fdfbc65937056082c5bff10
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N <dnarayan(a)redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga(a)redhat.com>