aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-09-20 02:09:40 -0700
committerRoss Brattain <ross.b.brattain@intel.com>2017-09-25 08:30:20 -0700
commitff4cc45743fd378ad401b5366ce3988a6e65a3fd (patch)
treed7cc9355c09aabe666cb5165fb2742e57c340076 /yardstick/network_services
parent5295078171b9c7436f945b081d3015e1052bf721 (diff)
prox: fix TG KPIs
The problem is that we share the same ProxResourceHelper for both VNF and TG. For VNF we want to talk to resource.py and get collectd KPIs. For TG we need to read from the queue the TG calculated KPIs and we also want collectd KPIs. workaround is to use a different method name collect_collectd_kpi for VNFs Change-Id: Icc2132758e37ce210f5600a0cd433077930208e5 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'yardstick/network_services')
-rw-r--r--yardstick/network_services/vnf_generic/vnf/prox_helpers.py12
-rw-r--r--yardstick/network_services/vnf_generic/vnf/prox_vnf.py4
2 files changed, 13 insertions, 3 deletions
diff --git a/yardstick/network_services/vnf_generic/vnf/prox_helpers.py b/yardstick/network_services/vnf_generic/vnf/prox_helpers.py
index 6b581b6b3..d24710132 100644
--- a/yardstick/network_services/vnf_generic/vnf/prox_helpers.py
+++ b/yardstick/network_services/vnf_generic/vnf/prox_helpers.py
@@ -907,10 +907,18 @@ class ProxResourceHelper(ClientResourceHelper):
LOG.debug("tg_prox done")
self._terminated.value = 1
- # use ResourceHelper method to collect KPIs directly.
- def collect_kpi(self):
+ # For VNF use ResourceHelper method to collect KPIs directly.
+ # for TG leave the superclass ClientResourceHelper collect_kpi_method intact
+ def collect_collectd_kpi(self):
return self._collect_resource_kpi()
+ def collect_kpi(self):
+ result = super(ProxResourceHelper, self).collect_kpi()
+ # add in collectd kpis manually
+ if result:
+ result['collect_stats'] = self._collect_resource_kpi()
+ return result
+
def terminate(self):
# should not be called, use VNF terminate
raise NotImplementedError()
diff --git a/yardstick/network_services/vnf_generic/vnf/prox_vnf.py b/yardstick/network_services/vnf_generic/vnf/prox_vnf.py
index e87d452b4..2ac6ea412 100644
--- a/yardstick/network_services/vnf_generic/vnf/prox_vnf.py
+++ b/yardstick/network_services/vnf_generic/vnf/prox_vnf.py
@@ -82,7 +82,9 @@ class ProxApproxVnf(SampleVNF):
"packets_in": tx_total,
"packets_dropped": (tx_total - rx_total),
"packets_fwd": rx_total,
- "collect_stats": self.resource_helper.collect_kpi(),
+ # we share ProxResourceHelper with TG, but we want to collect
+ # collectd KPIs here and not TG KPIs, so use a different method name
+ "collect_stats": self.resource_helper.collect_collectd_kpi(),
}
LOG.debug("%s collect KPIs %s", self.APP_NAME, result)
return result