aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-10-10 15:03:22 -0700
committerRoss Brattain <ross.b.brattain@intel.com>2017-10-13 13:59:38 -0700
commit42a1cbaf5636387c65849ef04c8dd83bfa916206 (patch)
treef4f70e8495da6112173711368f7513288b4b6bc8 /yardstick
parentc188b055fdbf754af4e51528e7946ea60115830b (diff)
collectd: set intel_pmu events path and OVS socket path
switch from hardcoded path to dynamic path based on bin_path also enable proxy for install_collectd add barometer settings for virt and ovs_stats Change-Id: Id138aef548332a3e3fcb3963b746e7c9f10c0948 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'yardstick')
-rw-r--r--yardstick/network_services/nfvi/collectd.conf18
-rw-r--r--yardstick/network_services/nfvi/resource.py35
2 files changed, 42 insertions, 11 deletions
diff --git a/yardstick/network_services/nfvi/collectd.conf b/yardstick/network_services/nfvi/collectd.conf
index e6a1f0d8c..b166fe7fd 100644
--- a/yardstick/network_services/nfvi/collectd.conf
+++ b/yardstick/network_services/nfvi/collectd.conf
@@ -24,10 +24,17 @@ Interval {{ interval }}
##############################################################################
#LoadPlugin syslog
-{% for plugin in loadplugins %}
+{% for plugin in loadplugins if plugin != "ovs_stats" %}
LoadPlugin {{ plugin }}
{% endfor %}
+{% if "ovs_stats" in plugins %}
+<LoadPlugin ovs_stats>
+ Interval 1
+</LoadPlugin>
+{% endif %}
+
+
##############################################################################
# Plugin configuration #
#----------------------------------------------------------------------------#
@@ -82,12 +89,11 @@ LoadPlugin {{ plugin }}
{% endif %}
{% if "intel_pmu" in plugins %}
-<Plugin intel_pmu>
+<Plugin "intel_pmu">
ReportHardwareCacheEvents true
ReportKernelPMUEvents true
ReportSoftwareEvents true
- EventList "/opt/nsb_bin/pmu_event.json"
- HardwareEvents "L2_RQSTS.CODE_RD_HIT,L2_RQSTS.CODE_RD_MISS" "L2_RQSTS.ALL_CODE_RD"
+ EventList "{{ plugins['intel_pmu']['pmu_event_path'] }}"
</Plugin>
{% endif %}
@@ -110,6 +116,8 @@ LoadPlugin {{ plugin }}
{% if "virt" in plugins %}
<Plugin "virt">
# monitor all domains
+ RefreshInterval 60
+ ExtraStats "cpu_util disk disk_err domain_state fs_info job_stats_background pcpu perf vcpupin"
</Plugin>
{% endif %}
@@ -117,7 +125,7 @@ LoadPlugin {{ plugin }}
<Plugin "ovs_stats">
Port "6640"
Address "127.0.0.1"
- Socket "/usr/local/var/run/openvswitch/db.sock"
+ Socket "{{ plugins['ovs_stats']['ovs_socket_path'] }}"
# don't specify bridges, monitor all bridges
</Plugin>
{% endif %}
diff --git a/yardstick/network_services/nfvi/resource.py b/yardstick/network_services/nfvi/resource.py
index fef44e207..dea754d8b 100644
--- a/yardstick/network_services/nfvi/resource.py
+++ b/yardstick/network_services/nfvi/resource.py
@@ -34,7 +34,7 @@ from yardstick import ssh
from yardstick.common.task_template import finalize_for_yaml
from yardstick.common.utils import validate_non_string_sequence
from yardstick.network_services.nfvi.collectd import AmqpConsumer
-from yardstick.network_services.utils import get_nsb_option
+
LOG = logging.getLogger(__name__)
@@ -53,6 +53,7 @@ class ResourceProfile(object):
AMPQ_PORT = 5672
DEFAULT_INTERVAL = 25
DEFAULT_TIMEOUT = 3600
+ OVS_SOCKET_PATH = "/usr/local/var/run/openvswitch/db.sock"
def __init__(self, mgmt, port_names=None, cores=None, plugins=None,
interval=None, timeout=None):
@@ -154,7 +155,6 @@ class ResourceProfile(object):
"dpdkstat": {},
"virt": {},
"ovs_stats": {},
- "intel_pmu": {},
}
testcase = ""
@@ -233,10 +233,32 @@ class ResourceProfile(object):
}
self._provide_config_file(config_file_path, self.COLLECTD_CONF, kwargs)
+ def _setup_intel_pmu(self, connection, bin_path):
+ pmu_event_path = os.path.join(bin_path, "pmu_event.json")
+ try:
+ self.plugins["intel_pmu"]["pmu_event_path"] = pmu_event_path
+ except KeyError:
+ # if intel_pmu is not a dict, force it into a dict
+ self.plugins["intel_pmu"] = {"pmu_event_path": pmu_event_path}
+ LOG.debug("Downloading event list for pmu_stats plugin")
+ cmd = 'cd {0}; PMU_EVENTS_PATH={1} python event_download_local.py'.format(
+ bin_path, pmu_event_path)
+ cmd = "sudo bash -c '{}'".format(cmd)
+ connection.execute(cmd)
+
+ def _setup_ovs_stats(self, connection):
+ try:
+ socket_path = self.plugins["ovs_stats"].get("ovs_socket_path", self.OVS_SOCKET_PATH)
+ except KeyError:
+ # ovs_stats is not a dict
+ socket_path = self.OVS_SOCKET_PATH
+ status = connection.execute("test -S {}".format(socket_path))[0]
+ if status != 0:
+ LOG.error("cannot find OVS socket %s", socket_path)
+
def _start_collectd(self, connection, bin_path):
LOG.debug("Starting collectd to collect NFVi stats")
connection.execute('sudo pkill -x -9 collectd')
- bin_path = get_nsb_option("bin_path")
collectd_path = os.path.join(bin_path, "collectd", "sbin", "collectd")
config_file_path = os.path.join(bin_path, "collectd", "etc")
exit_status = connection.execute("which %s > /dev/null 2>&1" % collectd_path)[0]
@@ -251,9 +273,10 @@ class ResourceProfile(object):
# collectd_installer, http_proxy, https_proxy))
return
if "intel_pmu" in self.plugins:
- LOG.debug("Downloading event list for pmu_stats plugin")
- cmd = 'sudo bash -c \'cd /opt/tempT/pmu-tools/; python event_download_local.py\''
- connection.execute(cmd)
+ self._setup_intel_pmu(connection, bin_path)
+ if "ovs_stats" in self.plugins:
+ self._setup_ovs_stats(connection)
+
LOG.debug("Starting collectd to collect NFVi stats")
# ensure collectd.conf.d exists to avoid error/warning
connection.execute("sudo mkdir -p /etc/collectd/collectd.conf.d")