diff options
author | ahothan <ahothan@cisco.com> | 2019-03-17 22:34:25 -0700 |
---|---|---|
committer | ahothan <ahothan@cisco.com> | 2019-03-17 22:43:25 -0700 |
commit | 634764bdb133f65515088be91f3a5049d6eb027e (patch) | |
tree | 159c29c7dcf558b5ab22dc1916c2c0f1c97611bb /nfvbench/stats_collector.py | |
parent | 727e863a026fc1f4fbb427bca86829627e954488 (diff) |
NFVBENCH-126 Remove socketio support (debt reduction)
Allow REST server to start in no-openstack mode
Fix pbr version (was set to 0.0.0)
Add docker-compose support
Update documentation for REST API
Change-Id: Ib520b09283ba6a878f802365292a7a829e6ccd09
Signed-off-by: ahothan <ahothan@cisco.com>
Diffstat (limited to 'nfvbench/stats_collector.py')
-rw-r--r-- | nfvbench/stats_collector.py | 51 |
1 files changed, 2 insertions, 49 deletions
diff --git a/nfvbench/stats_collector.py b/nfvbench/stats_collector.py index 964d704..dc750db 100644 --- a/nfvbench/stats_collector.py +++ b/nfvbench/stats_collector.py @@ -56,9 +56,7 @@ class IntervalCollector(StatsCollector): self.notifier = notifier def add(self, stats): - if self.notifier: - current_stats = self.__compute_tx_rx_diff(stats) - self.notifier.send_interval_stats(**current_stats) + pass def reset(self): # don't reset time! @@ -66,52 +64,7 @@ class IntervalCollector(StatsCollector): self.last_tx_pkts = 0 def add_ndr_pdr(self, tag, stats): - if self.notifier: - - current_time = self._get_current_time_diff() - rx_pps = self._get_rx_pps(stats['tx_pps'], stats['drop_percentage']) - - self.last_tx_pkts = stats['tx_pps'] / 1000 * (current_time - self.last_time) - self.last_rx_pkts = rx_pps / 1000 * (current_time - self.last_time) - self.last_time = current_time - - # 'drop_pct' key is an unfortunate name, since in iteration stats it means - # number of the packets. More suitable would be 'drop_percentage'. - # FDS frontend depends on this key - current_stats = { - '{}_pps'.format(tag): stats['tx_pps'], - 'tx_pps': stats['tx_pps'], - 'rx_pps': rx_pps, - 'drop_pct': stats['drop_percentage'], - 'time_ms': current_time - } - - self.notifier.send_interval_stats(time_ms=current_stats['time_ms'], - tx_pps=current_stats['tx_pps'], - rx_pps=current_stats['rx_pps'], - drop_pct=current_stats['drop_pct']) - if tag == 'ndr': - self.notifier.send_ndr_found(stats['tx_pps']) - else: - self.notifier.send_pdr_found(stats['tx_pps']) - - def __compute_tx_rx_diff(self, stats): - current_time = self._get_current_time_diff() - tx_diff = stats['overall']['tx']['total_pkts'] - self.last_tx_pkts - tx_pps = (tx_diff * 1000) / (current_time - self.last_time) - rx_diff = stats['overall']['rx']['total_pkts'] - self.last_rx_pkts - rx_pps = (rx_diff * 1000) / (current_time - self.last_time) - - self.last_rx_pkts = stats['overall']['rx']['total_pkts'] - self.last_tx_pkts = stats['overall']['tx']['total_pkts'] - self.last_time = current_time - - return { - 'tx_pps': tx_pps, - 'rx_pps': rx_pps, - 'drop_pct': max(0.0, (1 - (float(rx_pps) / tx_pps)) * 100), - 'time_ms': current_time - } + pass class IterationCollector(StatsCollector): |