Yaniv Bronhaim has uploaded a new change for review.
Change subject: Adding percent suffix to metric name spacing
......................................................................
Adding percent suffix to metric name spacing
Change-Id: Ibe87f2b9b31aaa9555b2df68689b5e9edbe398b9
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M lib/vdsm/health.py
M lib/vdsm/host/api.py
M lib/vdsm/metrics/__init__.py
3 files changed, 6 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/62335/1
diff --git a/lib/vdsm/health.py b/lib/vdsm/health.py
index 94c9f14..7b9aede 100644
--- a/lib/vdsm/health.py
+++ b/lib/vdsm/health.py
@@ -30,6 +30,7 @@
from . import host
from vdsm.metrics import MB
+from vdsm.metrics import PERCENT
from vdsm.metrics import send
_monitor = None
@@ -128,8 +129,8 @@
report = {}
report[prefix + '.gc.uncollectable'] = \
self._stats['uncollectable_obj']
- report[prefix + '.cpu.user_pct'] = self._stats['utime_pct']
- report[prefix + '.cpu.sys_pct'] = self._stats['stime_pct']
+ report[prefix + '.cpu.user' + PERCENT] =
self._stats['utime_pct']
+ report[prefix + '.cpu.sys' + PERCENT] = self._stats['stime_pct']
report[prefix + '.memory.rss' + MB] = self._stats['rss']
report[prefix + '.threads_count'] = self._stats['threads']
send(report)
diff --git a/lib/vdsm/host/api.py b/lib/vdsm/host/api.py
index 0fb7e3f..52f0e0c 100644
--- a/lib/vdsm/host/api.py
+++ b/lib/vdsm/host/api.py
@@ -31,6 +31,7 @@
from vdsm.define import Kbytes, Mbytes
from vdsm.metrics import JIFFIES
from vdsm.metrics import MB
+from vdsm.metrics import PERCENT
from vdsm.metrics import send
from vdsm.virt import vmstatus
@@ -117,7 +118,7 @@
if 'ksmPages' in hoststats:
data[prefix + '.cpu.ksm_pages'] = hoststats['ksmPages']
- data[prefix + '.cpu.ksm_cpu_precent'] = hoststats['ksmCpu']
+ data[prefix + '.cpu.ksm_cpu' + PERCENT] =
hoststats['ksmCpu']
if hoststats['haStats']['configured']:
data[prefix + '.ha_score'] = hoststats['haScore']
diff --git a/lib/vdsm/metrics/__init__.py b/lib/vdsm/metrics/__init__.py
index 1007310..f7714e0 100644
--- a/lib/vdsm/metrics/__init__.py
+++ b/lib/vdsm/metrics/__init__.py
@@ -26,6 +26,7 @@
# METRIC UNIT SUFFIX REPRESENTATION
MB = '_M'
JIFFIES = '_jiff'
+PERCENT = '_percent'
_reporter = None
--
To view, visit
https://gerrit.ovirt.org/62335
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe87f2b9b31aaa9555b2df68689b5e9edbe398b9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>