Change in vdsm[master]: utils: Optimize namedtuple definition in pidStat
nsoffer at redhat.com
nsoffer at redhat.com
Wed Mar 26 01:35:21 UTC 2014
Nir Soffer has posted comments on this change.
Change subject: utils: Optimize namedtuple definition in pidStat
......................................................................
Patch Set 1:
(1 comment)
http://gerrit.ovirt.org/#/c/26097/1/lib/vdsm/utils.py
File lib/vdsm/utils.py:
Line 344: res.extend([int(item) for item in args[1:]])
Line 345: # Only 44 feilds are documented in man page while /proc/pid/stat has 52
Line 346: # The rest of the fields contain the process memory layout and
Line 347: # exit_code, which are not relevant for our use.
Line 348: return STAT._make(res[:len(STAT._fields)])
Note: _fields is not a private. Like _make, it uses an underscore prefix to prevent conflicts with field names. See http://docs.python.org/2.7/library/collections.html#namedtuple-factory-function-for-tuples-with-named-fields.
Line 349:
Line 350:
Line 351: def iteratePids():
Line 352: for path in glob.iglob("/proc/[0-9]*"):
--
To view, visit http://gerrit.ovirt.org/26097
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5841b338cc0e9376c3bd7815206c27829c286d6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list