Change in vdsm[master]: vm: migration: exponential downtime increment
danken at redhat.com
danken at redhat.com
Tue Sep 16 10:26:15 UTC 2014
Dan Kenigsberg has posted comments on this change.
Change subject: vm: migration: exponential downtime increment
......................................................................
Patch Set 8: Code-Review-1
(3 comments)
minor nit
http://gerrit.ovirt.org/#/c/25820/8/tests/vmMigrationTests.py
File tests/vmMigrationTests.py:
Line 46: class TestVmMigrationDowntimeSequence(TestCaseBase):
Line 47:
Line 48: @permutations(_PARAMS)
Line 49: def test_downtime_is_sequence(self, dtime, steps):
Line 50: self.assertTrue(len(self._default(dtime, steps)) >= 2)
> can be rewritten as self.assertGreaterEqual(len(self._default(dtime, steps)
As Francesco noted to me, these were introduced only on Python 2.7 (we still need to support 2.6).
Line 51:
Line 52: @permutations(_PARAMS)
Line 53: def test_downtime_increasing(self, dtime, steps):
Line 54: for a, b in pairwise(self._default(dtime, steps)):
Line 107: def pairwise(iterable):
Line 108: "s -> (s0,s1), (s1,s2), (s2, s3), ..."
Line 109: a, b = tee(iterable)
Line 110: next(b, None)
Line 111: return izip(a, b)
> thought about this a bit, wouldn't importing islice and running izip(a, isl
I don't really understand your suggestion; I like copying the recipe unless there's a good reason not to.
Line 112:
Line 113:
Line 114: def _linear_downtime(downtime, steps):
Line 115: "this is the old formula as reference"
http://gerrit.ovirt.org/#/c/25820/8/vdsm/virt/migration.py
File vdsm/virt/migration.py:
Line 355:
Line 356:
Line 357: def exponential_downtime(downtime, steps):
Line 358: offset = downtime / float(steps)
Line 359: base = (downtime - offset) ** (1 / float(steps-1))
space around operator
Line 360:
Line 361: for i in range(steps):
Line 362: yield int(offset + base ** i)
Line 363:
--
To view, visit http://gerrit.ovirt.org/25820
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I6401772f52ea28144452e67198bddff18f6703eb
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr 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