Hello Nir Soffer, Francesco Romani,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/60846
to review the following change.
Change subject: Modify reports to metrics
......................................................................
Modify reports to metrics
Reports is more about the output graphs. The idea behind this module is
to send metrics information. This patch changes the name. The config
section in vdsm.conf is changed to [metrics].
Reports can be misleading.
Change-Id: Ib0aa10042b1c50fbdd94ae69053c74b57c3e6f40
Signed-off-by: Yaniv Bronhaim <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/60450
Reviewed-by: Irit Goihman <[email protected]>
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <[email protected]>
Reviewed-by: Nir Soffer <[email protected]>
---
M configure.ac
M lib/vdsm/Makefile.am
M lib/vdsm/config.py.in
M lib/vdsm/health.py
M lib/vdsm/host/api.py
R lib/vdsm/metrics/Makefile.am
R lib/vdsm/metrics/__init__.py
R lib/vdsm/metrics/hawkular.py
R lib/vdsm/metrics/statsd.py
M vdsm.spec.in
M vdsm/vdsm
11 files changed, 25 insertions(+), 25 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/60846/1
diff --git a/configure.ac b/configure.ac
index a945869..a05eba0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -432,7 +432,7 @@
lib/vdsm/network/ovs/Makefile
lib/vdsm/network/ovs/driver/Makefile
lib/vdsm/network/tc/Makefile
- lib/vdsm/reports/Makefile
+ lib/vdsm/metrics/Makefile
lib/vdsm/rpc/Makefile
lib/vdsm/storage/Makefile
lib/vdsm/virt/Makefile
diff --git a/lib/vdsm/Makefile.am b/lib/vdsm/Makefile.am
index c49ee61..a89e8b2 100644
--- a/lib/vdsm/Makefile.am
+++ b/lib/vdsm/Makefile.am
@@ -19,7 +19,7 @@
#
include $(top_srcdir)/build-aux/Makefile.subs
-SUBDIRS=common tool infra profiling rpc network virt storage host reports
+SUBDIRS=common tool infra profiling rpc network virt storage host metrics
dist_vdsmpylib_PYTHON = \
__init__.py \
diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index d9d6f36..2b0d4d6 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -438,21 +438,21 @@
' This is for internal usage and may change without warning'),
]),
- # Section: [reports]
- ('reports', [
+ # Section: [metrics]
+ ('metrics', [
('enabled', 'false',
- 'Enable metric reporting (default false)'),
+ 'Enable metrics collection (default false)'),
('collector_address', 'localhost',
- 'Reports collector address (default localhost)'),
+ 'Metrics collector address (default localhost)'),
('collector_type', 'statsd',
- 'Reports collector type (supporting statsd or hawkular)'),
+ 'Metrics collector type (supporting statsd or hawkular)'),
('queue_size', '100',
- 'Number of reports to queue if collector is not responsive.'
- ' When the queue is full, oldest reports are dropped. Used only'
- ' by hawkular reporter (default 100).'),
+ 'Number of metrics messages to queue if collector is not'
+ ' responsive. When the queue is full, oldest messages are'
+ ' dropped. Used only by hawkular-client collector (default 100)'),
]),
# Section: [devel]
diff --git a/lib/vdsm/health.py b/lib/vdsm/health.py
index 85dcbc6..77e8780 100644
--- a/lib/vdsm/health.py
+++ b/lib/vdsm/health.py
@@ -27,7 +27,7 @@
from . config import config
from . import concurrent
from . import cpuarch
-from . import reports
+from . import metrics
from . import host
_monitor = None
@@ -130,7 +130,7 @@
report[prefix + '.cpu.sys_pct'] = self._stats['stime_pct']
report[prefix + '.memory.rss'] = self._stats['rss']
report[prefix + '.threads_count'] = self._stats['threads']
- reports.send(report)
+ metrics.send(report)
class ProcStat(object):
diff --git a/lib/vdsm/host/api.py b/lib/vdsm/host/api.py
index b93900b..f55fa10 100644
--- a/lib/vdsm/host/api.py
+++ b/lib/vdsm/host/api.py
@@ -27,7 +27,7 @@
from vdsm import cpuarch
from vdsm import hooks
from vdsm import utils
-from vdsm import reports
+from vdsm import metrics
from vdsm.config import config
from vdsm.define import Kbytes, Mbytes
from vdsm.virt import vmstatus
@@ -132,7 +132,7 @@
report[net_prefix + '.rx'] = if_info['rx']
report[net_prefix + '.tx'] = if_info['tx']
- reports.send(report)
+ metrics.send(report)
except KeyError:
logging.exception('Report host stats failed')
diff --git a/lib/vdsm/reports/Makefile.am b/lib/vdsm/metrics/Makefile.am
similarity index 91%
rename from lib/vdsm/reports/Makefile.am
rename to lib/vdsm/metrics/Makefile.am
index 5284662..d7dd575 100644
--- a/lib/vdsm/reports/Makefile.am
+++ b/lib/vdsm/metrics/Makefile.am
@@ -18,5 +18,5 @@
#
include $(top_srcdir)/build-aux/Makefile.subs
-vdsmreportsdir = $(vdsmpylibdir)/reports
-dist_vdsmreports_PYTHON = *.py
+vdsmmetricsdir = $(vdsmpylibdir)/metrics
+dist_vdsmmetrics_PYTHON = *.py
diff --git a/lib/vdsm/reports/__init__.py b/lib/vdsm/metrics/__init__.py
similarity index 86%
rename from lib/vdsm/reports/__init__.py
rename to lib/vdsm/metrics/__init__.py
index 0f6c65e..9ea0985 100644
--- a/lib/vdsm/reports/__init__.py
+++ b/lib/vdsm/metrics/__init__.py
@@ -28,11 +28,11 @@
def start():
global _reporter
- if config.getboolean('reports', 'enabled'):
+ if config.getboolean('metrics', 'enabled'):
_reporter = importlib.import_module(
- 'vdsm.reports.' + config.get('reports', 'collector_type')
+ 'vdsm.metrics.' + config.get('metrics', 'collector_type')
)
- _reporter.start(config.get('reports', 'collector_address'))
+ _reporter.start(config.get('metrics', 'collector_address'))
def stop():
diff --git a/lib/vdsm/reports/hawkular.py b/lib/vdsm/metrics/hawkular.py
similarity index 96%
rename from lib/vdsm/reports/hawkular.py
rename to lib/vdsm/metrics/hawkular.py
index c30a3f7..587aa00 100644
--- a/lib/vdsm/reports/hawkular.py
+++ b/lib/vdsm/metrics/hawkular.py
@@ -31,7 +31,7 @@
from vdsm.config import config
_running = False
-_queue = collections.deque(maxlen=config.getint('reports', 'queue_size'))
+_queue = collections.deque(maxlen=config.getint('metrics', 'queue_size'))
_cond = threading.Condition(threading.Lock())
_STOP = object()
diff --git a/lib/vdsm/reports/statsd.py b/lib/vdsm/metrics/statsd.py
similarity index 100%
rename from lib/vdsm/reports/statsd.py
rename to lib/vdsm/metrics/statsd.py
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 94a1a67..b4940f3 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -1163,7 +1163,7 @@
%dir %{python_sitelib}/%{vdsm_name}/network/ovs
%dir %{python_sitelib}/%{vdsm_name}/network/ovs/driver
%dir %{python_sitelib}/%{vdsm_name}/network/tc
-%dir %{python_sitelib}/%{vdsm_name}/reports
+%dir %{python_sitelib}/%{vdsm_name}/metrics
%dir %{python_sitelib}/%{vdsm_name}/tool
%dir %{python_sitelib}/%{vdsm_name}/tool/configurators
%dir %{python_sitelib}/%{vdsm_name}/profiling
@@ -1196,6 +1196,7 @@
%{python_sitelib}/%{vdsm_name}/logUtils.py*
%{python_sitelib}/%{vdsm_name}/m2cutils.py*
%{python_sitelib}/%{vdsm_name}/machinetype.py*
+%{python_sitelib}/%{vdsm_name}/metrics/*.py*
%{python_sitelib}/%{vdsm_name}/moduleloader.py*
%{python_sitelib}/%{vdsm_name}/momIF.py*
%{python_sitelib}/%{vdsm_name}/network/__init__.py*
@@ -1248,7 +1249,6 @@
%{python_sitelib}/%{vdsm_name}/profiling/errors.py*
%{python_sitelib}/%{vdsm_name}/profiling/memory.py*
%{python_sitelib}/%{vdsm_name}/profiling/profile.py*
-%{python_sitelib}/%{vdsm_name}/reports/*.py*
%{python_sitelib}/%{vdsm_name}/storage/__init__.py*
%{python_sitelib}/%{vdsm_name}/storage/asyncevent.py*
%{python_sitelib}/%{vdsm_name}/storage/blkdiscard.py*
diff --git a/vdsm/vdsm b/vdsm/vdsm
index 1cb5dda..ec6cb03 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -39,7 +39,7 @@
from vdsm.config import config
from vdsm import libvirtconnection
from vdsm import taskset
-from vdsm import reports
+from vdsm import metrics
from vdsm.panic import panic
from vdsm.profiling import profile
@@ -85,7 +85,7 @@
zombiereaper.registerSignalHandler()
profile.start()
- reports.start()
+ metrics.start()
libvirtconnection.start_event_loop()
@@ -114,7 +114,7 @@
profile.stop()
finally:
- reports.stop()
+ metrics.stop()
health.stop()
periodic.stop()
cif.prepareForShutdown()
--
To view, visit https://gerrit.ovirt.org/60846
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib0aa10042b1c50fbdd94ae69053c74b57c3e6f40
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/admin/lists/[email protected]