Change in vdsm[master]: vdsmapi: fix a typo in string formatting
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has submitted this change and it was merged.
Change subject: vdsmapi: fix a typo in string formatting
......................................................................
vdsmapi: fix a typo in string formatting
There was a typo in SchemaNotFound error message: "%"
was replaced with "," - causing bad exception message display.
Change-Id: I1959b4c6ff64155af9b255e0a62bbbe040d2e027
Signed-off-by: Irit Goihman <igoihman(a)redhat.com>
---
M lib/api/vdsmapi.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Piotr Kliczewski: Looks good to me, approved
Jenkins CI: Passed CI tests
Irit Goihman: Verified
--
To view, visit https://gerrit.ovirt.org/67647
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1959b4c6ff64155af9b255e0a62bbbe040d2e027
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Irit Goihman <igoihman(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
7 years
Change in vdsm[master]: Adding StatsClient to code base to avoid using python-statsd...
by Code Review
From Yaniv Bronhaim <ybronhei(a)redhat.com>:
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Adding StatsClient to code base to avoid using python-statsd package
......................................................................
Adding StatsClient to code base to avoid using python-statsd package
The code is not so complex so I copied it. We use only few parts of it.
I might remove also the rest that we don't use. Quite simple
Change-Id: I7bbc8a4c0e3afc25c205bfec58c5e77096803404
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M lib/vdsm/metrics/statsd.py
1 file changed, 52 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/04/67004/1
diff --git a/lib/vdsm/metrics/statsd.py b/lib/vdsm/metrics/statsd.py
index f471317..24562aa 100644
--- a/lib/vdsm/metrics/statsd.py
+++ b/lib/vdsm/metrics/statsd.py
@@ -19,14 +19,11 @@
#
from __future__ import absolute_import
+from __future__ import with_statement
+import random
import six
-from vdsm import compat
-
-try:
- import statsd
-except ImportError as e:
- raise compat.Unsupported(str(e))
+import socket
_client = None
@@ -34,7 +31,7 @@
def start(address):
global _client
if _client is None:
- _client = statsd.StatsClient(host=address)
+ _client = StatsClient(host=address)
def stop():
@@ -45,3 +42,51 @@
def send(report):
for name, value in six.iteritems(report):
_client.gauge(name, value)
+
+
+class StatsClient(object):
+ def __init__(self, host='localhost', port=8125, prefix=None,
+ maxudpsize=512, ipv6=False):
+ fam = socket.AF_INET6 if ipv6 else socket.AF_INET
+ family, _, _, _, addr = socket.getaddrinfo(
+ host, port, fam, socket.SOCK_DGRAM)[0]
+ self._addr = addr
+ self._sock = socket.socket(family, socket.SOCK_DGRAM)
+ self._prefix = prefix
+ self._maxudpsize = maxudpsize
+
+ def _send(self, data):
+ try:
+ self._sock.sendto(data.encode('ascii'), self._addr)
+ except (socket.error, RuntimeError):
+ pass
+
+ def gauge(self, stat, value, rate=1, delta=False):
+ if value < 0 and not delta:
+ if rate < 1:
+ if random.random() > rate:
+ return
+ with self.pipeline() as pipe:
+ pipe._send_stat(stat, '0|g', 1)
+ pipe._send_stat(stat, '%s|g' % value, 1)
+ else:
+ prefix = '+' if delta and value >= 0 else ''
+ self._send_stat(stat, '%s%s|g' % (prefix, value), rate)
+
+ def _send_stat(self, stat, value, rate):
+ self._after(self._prepare(stat, value, rate))
+
+ def _prepare(self, stat, value, rate):
+ if rate < 1:
+ if random.random() > rate:
+ return
+ value = '%s|@%s' % (value, rate)
+
+ if self._prefix:
+ stat = '%s.%s' % (self._prefix, stat)
+
+ return '%s:%s' % (stat, value)
+
+ def _after(self, data):
+ if data:
+ self._send(data)
--
To view, visit https://gerrit.ovirt.org/67004
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7bbc8a4c0e3afc25c205bfec58c5e77096803404
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
7 years
Change in vdsm[master]: vdsmapi: fix a typo in string formatting
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has posted comments on this change.
Change subject: vdsmapi: fix a typo in string formatting
......................................................................
Patch Set 2:
Code Review - Error
Cannot merge 5caf87ee65588a7041cb585dac58ca715951004e
Missing dependency
???
Let's try a rebase...
--
To view, visit https://gerrit.ovirt.org/67647
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1959b4c6ff64155af9b255e0a62bbbe040d2e027
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Irit Goihman <igoihman(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years
Change in vdsm[master]: client: introduce MissingSchemaError exception
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has posted comments on this change.
Change subject: client: introduce MissingSchemaError exception
......................................................................
Patch Set 2: Continuous-Integration+1
10:46:33 http://proxy.phx.ovirt.org:5000/fedora-updates-debuginfo/24/x86_64/repoda...: [Errno 14] HTTP Error 502 - Bad Gateway
10:46:33 Took 59 seconds
--
To view, visit https://gerrit.ovirt.org/67648
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I4d2068376a2776a18c07c3e25ea7cecea3126840
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Irit Goihman <igoihman(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years
Change in vdsm[master]: network: devices: properly initialize attributes
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: network: devices: properly initialize attributes
......................................................................
network: devices: properly initialize attributes
The `name' attribute used to be added to devices only after the
device data was refreshed from libvirt.
This can lead to AttributeErrors if a VM starts (very) slowly.
Furthermore, is good practice to initialize all the device
object attributes in __init__.
Change-Id: I21ef87a9524cbfe752e6cc0f7d1d9f6139c61dfb
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/vmdevices/network.py
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/72/65772/1
diff --git a/vdsm/virt/vmdevices/network.py b/vdsm/virt/vmdevices/network.py
index 7628f06..618c34d 100644
--- a/vdsm/virt/vmdevices/network.py
+++ b/vdsm/virt/vmdevices/network.py
@@ -48,6 +48,7 @@
kwargs[attr] = net_api.DUMMY_BRIDGE
super(Interface, self).__init__(conf, log, **kwargs)
self.sndbufParam = False
+ self.name = ""
self.is_hostdevice = self.device == hwclass.HOSTDEV
self.vlanId = self.specParams.get('vlanid')
self._customize()
--
To view, visit https://gerrit.ovirt.org/65772
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I21ef87a9524cbfe752e6cc0f7d1d9f6139c61dfb
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
7 years
Change in vdsm[master]: API: move vm parameters fixup in a method
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has submitted this change and it was merged.
Change subject: API: move vm parameters fixup in a method
......................................................................
API: move vm parameters fixup in a method
After the VM parameter validation, the API.VM.create
method does some parameter fixing, meaning it adds
back some optional parameters if they are not provided
explicitely.
This patch moves this code on its own submethod.
Change-Id: Ia46a63ac8f321860a5718d1af9c412e537646cc9
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/API.py
1 file changed, 15 insertions(+), 11 deletions(-)
Approvals:
Jenkins CI: Passed CI tests
Dan Kenigsberg: Verified; Looks good to me, approved
--
To view, visit https://gerrit.ovirt.org/66416
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia46a63ac8f321860a5718d1af9c412e537646cc9
Gerrit-PatchSet: 12
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
7 years
Change in vdsm[master]: hostdev: add test for massive number of devices
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has submitted this change and it was merged.
Change subject: hostdev: add test for massive number of devices
......................................................................
hostdev: add test for massive number of devices
We have not really tested the most perf-wise fragile part of the code.
We therefore add a test case which iterates over ~3k devices.
Change-Id: If0f891dc8630d1dab971df228652f5d757db2e14
Bug-Url: https://bugzilla.redhat.com/1398572
Signed-off-by: Martin Polednik <mpolednik(a)redhat.com>
---
M tests/devices/data/Makefile.am
A tests/devices/data/devicetree.xml
M tests/hostdevTests.py
M tests/vmfakecon.py
4 files changed, 242 insertions(+), 0 deletions(-)
Approvals:
Jenkins CI: Passed CI tests
Dan Kenigsberg: Looks good to me, approved
Francesco Romani: Looks good to me, but someone else must approve
Martin Polednik: Verified
--
To view, visit https://gerrit.ovirt.org/67456
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If0f891dc8630d1dab971df228652f5d757db2e14
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
7 years
Change in vdsm[master]: rename method wrapApiMethod to _wrap_api_method
by Code Review
From Yaniv Bronhaim <ybronhei(a)redhat.com>:
Yaniv Bronhaim has posted comments on this change.
Change subject: rename method wrapApiMethod to _wrap_api_method
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.ovirt.org/67665
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I53dd08eae8547831d02f37cc6178184b3589cc0b
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ramesh N <rnachimu(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Ramesh N <rnachimu(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years
Change in vdsm[master]: Remove the usage of clientIF from GlusterApi
by Code Review
From Yaniv Bronhaim <ybronhei(a)redhat.com>:
Yaniv Bronhaim has posted comments on this change.
Change subject: Remove the usage of clientIF from GlusterApi
......................................................................
Patch Set 3: Code-Review+1
(1 comment)
https://gerrit.ovirt.org/#/c/67660/3/lib/vdsm/rpc/bindingxmlrpc.py
File lib/vdsm/rpc/bindingxmlrpc.py:
Line 1293: cif.log.info("RPC call %s finished (code=%s) in "
Line 1294: "%.2f seconds",
Line 1295: f.__name__,
Line 1296: res.get('status', {}).get('code'),
Line 1297: utils.monotonic_time() - start_time)
wonder why it wasn't like that from the beginning..
Line 1298: wrapper.__name__ = f.__name__
Line 1299: wrapper.__doc__ = f.__doc__
Line 1300: return wrapper
Line 1301:
--
To view, visit https://gerrit.ovirt.org/67660
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Id08bb1ff6d988aa06aca993378f3eb96fd7270a2
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ramesh N <rnachimu(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Irit Goihman <igoihman(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Ramesh N <rnachimu(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: Yes
7 years
Change in vdsm[master]: hostdev: add test for massive number of devices
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has posted comments on this change.
Change subject: hostdev: add test for massive number of devices
......................................................................
Patch Set 7: Code-Review+2
--
To view, visit https://gerrit.ovirt.org/67456
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If0f891dc8630d1dab971df228652f5d757db2e14
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years