Hello Antoni Segura Puimedon,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/29644
to review the following change.
Change subject: eliminate sampling.BaseSample
......................................................................
eliminate sampling.BaseSample
For quite some time, BaseSample is not a common base class of anything.
It serves no meaningful abstraction, so this patch inlines into its only
user.
Change-Id: Ia1668e89ac21229cea1d5aac7ea155882f4295a0
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
Reviewed-on:
http://gerrit.ovirt.org/29471
Reviewed-by: Antoni Segura Puimedon <asegurap(a)redhat.com>
---
M vdsm/virt/sampling.py
1 file changed, 6 insertions(+), 14 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/29644/1
diff --git a/vdsm/virt/sampling.py b/vdsm/virt/sampling.py
index 4ef9890..38490c3 100644
--- a/vdsm/virt/sampling.py
+++ b/vdsm/virt/sampling.py
@@ -188,18 +188,6 @@
self.timestamp = time.time()
-class BaseSample(TimedSample):
- """
- A sample of the statistics for a process.
- """
- def __init__(self, pid, ifids):
- TimedSample.__init__(self)
- self.interfaces = {}
- for ifid in ifids:
- self.interfaces[ifid] = InterfaceSample(ifid)
- self.pidcpu = PidCpuSample(pid)
-
-
_PROC_STAT_PATH = '/proc/stat'
@@ -221,7 +209,7 @@
raise ValueError('Boot time not present')
-class HostSample(BaseSample):
+class HostSample(TimedSample):
"""
A sample of host-related statistics.
@@ -250,7 +238,11 @@
:param ifids: The IDs of the interfaces you want to sample.
:type: list
"""
- BaseSample.__init__(self, pid, ifids)
+ TimedSample.__init__(self)
+ self.interfaces = {}
+ for ifid in ifids:
+ self.interfaces[ifid] = InterfaceSample(ifid)
+ self.pidcpu = PidCpuSample(pid)
self.totcpu = TotalCpuSample()
meminfo = utils.readMemInfo()
freeOrCached = (meminfo['MemFree'] +
--
To view, visit
http://gerrit.ovirt.org/29644
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia1668e89ac21229cea1d5aac7ea155882f4295a0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>