diff options
Diffstat (limited to 'yardstick')
-rw-r--r-- | yardstick/network_services/nfvi/collectd.conf | 8 | ||||
-rwxr-xr-x | yardstick/network_services/nfvi/collectd.sh | 23 | ||||
-rw-r--r-- | yardstick/network_services/nfvi/resource.py | 11 | ||||
-rw-r--r-- | yardstick/network_services/vnf_generic/vnf/tg_ixload.py | 15 |
4 files changed, 46 insertions, 11 deletions
diff --git a/yardstick/network_services/nfvi/collectd.conf b/yardstick/network_services/nfvi/collectd.conf index 6d8b73f7f..3928dcbca 100644 --- a/yardstick/network_services/nfvi/collectd.conf +++ b/yardstick/network_services/nfvi/collectd.conf @@ -67,6 +67,14 @@ Interval {interval} Cores "" </Plugin> +<Plugin intel_pmu> + ReportHardwareCacheEvents true + ReportKernelPMUEvents true + ReportSoftwareEvents true + EventList "/root/.cache/pmu-events/GenuineIntel-6-2D-core.json" + HardwareEvents "L2_RQSTS.CODE_RD_HIT,L2_RQSTS.CODE_RD_MISS" "L2_RQSTS.ALL_CODE_RD" +</Plugin> + <Plugin hugepages> ReportPerNodeHP true ReportRootHP true diff --git a/yardstick/network_services/nfvi/collectd.sh b/yardstick/network_services/nfvi/collectd.sh index 7666404e4..296c4a213 100755 --- a/yardstick/network_services/nfvi/collectd.sh +++ b/yardstick/network_services/nfvi/collectd.sh @@ -104,6 +104,24 @@ else popd fi +ls $INSTALL_NSB_BIN/pmu-tools >/dev/null +if [ $? -eq 0 ] +then + echo "DPDK already installed. Done" +else + cd $INSTALL_NSB_BIN + + git clone https://github.com/andikleen/pmu-tools.git + cd pmu-tools + cd jevents + sed -i -e 's/CFLAGS := -g -Wall -O2 -Wno-unused-result/CFLAGS := -g -Wall -O2 -Wno-unused-result -fPIC/g' Makefile + make + sudo make install + cd $INSTALL_NSB_BIN/pmu-tools + python event_download.py +fi + +cd $INSTALL_NSB_BIN which $INSTALL_NSB_BIN/collectd/collectd >/dev/null if [ $? -eq 0 ] then @@ -115,9 +133,8 @@ else git clone https://github.com/collectd/collectd.git pushd collectd git stash - git checkout -b nfvi 47c86ace348a1d7a5352a83d10935209f89aa4f5 ./build.sh - ./configure --with-libpqos=/usr/ --with-libdpdk=/usr --with-libyajl=/usr/local --enable-debug --enable-dpdkstat --enable-virt --enable-ovs_stats + ./configure --with-libpqos=/usr/ --with-libdpdk=/usr --with-libyajl=/usr/local --with-libjevents=/usr/local --enable-debug --enable-dpdkstat --enable-virt --enable-ovs_stats --enable-intel_pmu --prefix=$INSTALL_NSB_BIN/collectd make install > /dev/null popd echo "Done." @@ -126,7 +143,7 @@ fi modprobe msr cp $INSTALL_NSB_BIN/collectd.conf /opt/collectd/etc/ - +sudo service rabbitmq-server restart echo "Check if admin user already created" rabbitmqctl list_users | grep '^admin$' > /dev/null if [ $? -eq 0 ]; diff --git a/yardstick/network_services/nfvi/resource.py b/yardstick/network_services/nfvi/resource.py index 2a9a1a1a2..f0ae67616 100644 --- a/yardstick/network_services/nfvi/resource.py +++ b/yardstick/network_services/nfvi/resource.py @@ -35,7 +35,7 @@ CONF = cfg.CONF ZMQ_OVS_PORT = 5567 ZMQ_POLLING_TIME = 12000 LIST_PLUGINS_ENABLED = ["amqp", "cpu", "cpufreq", "intel_rdt", "memory", - "hugepages", "dpdkstat", "virt", "ovs_stats"] + "hugepages", "dpdkstat", "virt", "ovs_stats", "intel_pmu"] class ResourceProfile(object): @@ -109,6 +109,10 @@ class ResourceProfile(object): def parse_ovs_stats(cls, key, value): return cls.parse_simple_resource(key, value) + @classmethod + def parse_intel_pmu_stats(cls, key, value): + return {''.join(key): value.split(":")[1]} + def parse_collectd_result(self, metrics, core_list): """ convert collectd data into json""" result = { @@ -118,6 +122,7 @@ class ResourceProfile(object): "dpdkstat": {}, "virt": {}, "ovs_stats": {}, + "intel_pmu": {}, } testcase = "" @@ -148,6 +153,9 @@ class ResourceProfile(object): elif "ovs_stats" in res_key0: result["ovs_stats"].update(self.parse_ovs_stats(key_split, value)) + elif "intel_pmu-all" in res_key0: + result["intel_pmu"].update(self.parse_intel_pmu_stats(res_key1, value)) + result["timestamp"] = testcase return result @@ -192,7 +200,6 @@ class ResourceProfile(object): "loadplugin": loadplugin, "dpdk_interface": interfaces, } - self._provide_config_file(bin_path, 'collectd.conf', kwargs) def _start_collectd(self, connection, bin_path): diff --git a/yardstick/network_services/vnf_generic/vnf/tg_ixload.py b/yardstick/network_services/vnf_generic/vnf/tg_ixload.py index 6be2b58e1..612799ff5 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_ixload.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_ixload.py @@ -22,8 +22,6 @@ import shutil from collections import OrderedDict from subprocess import call -import six - from yardstick.common.utils import makedirs from yardstick.network_services.vnf_generic.vnf.sample_vnf import SampleVNFTrafficGen from yardstick.network_services.vnf_generic.vnf.sample_vnf import ClientResourceHelper @@ -79,6 +77,7 @@ class IxLoadResourceHelper(ClientResourceHelper): super(IxLoadResourceHelper, self).__init__(setup_helper) self.result = OrderedDict((key, ResourceDataHelper()) for key in self.KPI_LIST) self.resource_file_name = '' + self.data = None def parse_csv_read(self, reader): for row in reader: @@ -111,6 +110,12 @@ class IxLoadResourceHelper(ClientResourceHelper): return {key_right: self.result[key_left].get_aggregates() for key_left, key_right in self.KPI_LIST.items()} + def collect_kpi(self): + if self.data: + self._result.update(self.data) + LOG.info("Collect {0} KPIs {1}".format(self.RESOURCE_WORD, self._result)) + return self._result + def log(self): for key in self.KPI_LIST: LOG.debug(self.result[key]) @@ -125,7 +130,6 @@ class IxLoadTrafficGen(SampleVNFTrafficGen): super(IxLoadTrafficGen, self).__init__(name, vnfd, setup_env_helper_type, resource_helper_type) self._result = {} - self.data = None def run_traffic(self, traffic_profile): ports = [] @@ -156,16 +160,15 @@ class IxLoadTrafficGen(SampleVNFTrafficGen): with open(self.ssh_helper.join_bin_path("ixLoad_HTTP_Client.csv")) as csv_file: lines = csv_file.readlines()[10:] - with open(self.ssh_helper.join_bin_path("http_result.csv"), 'wb+') as result_file: - result_file.writelines(six.text_type(lines[:-1])) + result_file.writelines(lines[:-1]) result_file.flush() result_file.seek(0) reader = csv.DictReader(result_file) self.resource_helper.parse_csv_read(reader) self.resource_helper.log() - self.data = self.resource_helper.make_aggregates() + self.resource_helper.data = self.resource_helper.make_aggregates() def listen_traffic(self, traffic_profile): pass |