Change in vdsm[master]: Move host stats dict creation from API.py to host module

mpolednik at redhat.com mpolednik at redhat.com
Thu May 5 10:11:58 UTC 2016


Martin Polednik has posted comments on this change.

Change subject: Move host stats dict creation from API.py to host module
......................................................................


Patch Set 6:

(1 comment)

https://gerrit.ovirt.org/#/c/56874/6/lib/vdsm/host.py
File lib/vdsm/host.py:

Line 74: 
Line 75:     return host_UUID
Line 76: 
Line 77: 
Line 78: def getStats(irs, cif, haClient):
> Having a package can work, but do we have enough code for a package?
We actually do have lots of code in lib/ that can be moved to lib/vdsm/common/host/* (speaking of my modules like hostdev, numa and stuff that no one cares about enough :) ). Also, having something like

 lib/vdsm/common/host/api.py

is perfect, since getCaps can be moved there also (and getStats + getCaps already form enough code to satisfy their own module), leading to a very nice api:

 lib/vdsm/common/host/api:stats()
 lib/vdsm/common/host/api:caps()

I don't see a reason why the code in your example "sucks".
Line 79:     """
Line 80:     Retreive host internal statistics
Line 81:     """
Line 82:     hooks.before_get_stats()


-- 
To view, visit https://gerrit.ovirt.org/56874
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I626a673c429d486ac78b309c2f31cb58af8852b2
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Irit Goihman <igoihman at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list