diff options
author | Luc Provoost <luc.provoost@intel.com> | 2020-07-15 13:51:02 +0200 |
---|---|---|
committer | Xavier Simonart <xavier.simonart@intel.com> | 2020-08-03 07:28:50 +0000 |
commit | 7c31f36447aa16122ff4b6d1706f7f134d61c1f5 (patch) | |
tree | cc74bd9f56d96caf4ce70ab560e625f276f253c0 /VNFs/DPPD-PROX/helper-scripts/rapid/rapid_portstatstest.py | |
parent | 0973d6613091c8ac51215ed48bfd7cef116d02d8 (diff) |
Improved IRQ measurements and pushing results
The IRQ test has been reworked to increase the accuracy of the IRQ
measurements. Results can now also be pushed to a Prometheus push
gateway or to OPNFV's Xtesting. In order to do so, a new file
format.yaml has been introduced. Please use this file now to specify the
details of the PushGateway or the Xtesting server.
Added new test: increment_till_fail.test
Change-Id: I111aae3e099bc03e3d2ddd1014a0301bac356e0b
Signed-off-by: Luc Provoost <luc.provoost@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/rapid_portstatstest.py')
-rw-r--r-- | VNFs/DPPD-PROX/helper-scripts/rapid/rapid_portstatstest.py | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_portstatstest.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_portstatstest.py index 6991e879..90bf5b28 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_portstatstest.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_portstatstest.py @@ -27,15 +27,12 @@ class PortStatsTest(RapidTest): """ Class to manage the portstatstesting """ - def __init__(self, test_param, runtime, pushgateway, environment_file, + def __init__(self, test_param, runtime, testname, environment_file, machines): - super().__init__(test_param, runtime, pushgateway, environment_file) + super().__init__(test_param, runtime, testname, environment_file) self.machines = machines def run(self): - # fieldnames = ['PROXID','Time','Received','Sent','NoMbufs','iErrMiss'] - # writer = csv.DictWriter(data_csv_file, fieldnames=fieldnames) - # writer.writeheader() RapidLog.info("+---------------------------------------------------------------------------+") RapidLog.info("| Measuring port statistics on 1 or more PROX instances |") RapidLog.info("+-----------+-----------+------------+------------+------------+------------+") @@ -69,15 +66,15 @@ class PortStatsTest(RapidTest): old_errors[i] = new_errors[i] old_tsc[i] = new_tsc[i] RapidLog.info('|{:>10.0f}'.format(i)+ ' |{:>10.0f}'.format(duration)+' | ' + '{:>10.0f}'.format(rx) + ' | ' +'{:>10.0f}'.format(tx) + ' | '+'{:>10.0f}'.format(no_mbufs)+' | '+'{:>10.0f}'.format(errors)+' |') - # writer.writerow({'PROXID':i,'Time':duration,'Received':rx,'Sent':tx,'NoMbufs':no_mbufs,'iErrMiss':errors}) - if self.test['pushgateway']: - URL = self.test['pushgateway'] + self.test['test'] + '/instance/' + self.test['environment_file'] + str(i) - DATA = 'PROXID {}\nTime {}\n Received {}\nSent {}\nNoMbufs {}\niErrMiss {}\n'.format(i,duration,rx,tx,no_mbufs,errors) - HEADERS = {'X-Requested-With': 'Python requests', 'Content-type': 'text/xml'} - response = requests.post(url=URL, data=DATA,headers=HEADERS) - if (response.status_code != 202) and (response.status_code != 200): - RapidLog.info('Cannot send metrics to {}'.format(URL)) - RapidLog.info(DATA) + variables = {'test': self.test['test'], + 'environment_file': self.test['environment_file'], + 'PROXID': i, + 'StepSize': duration, + 'Received': rx, + 'Sent': tx, + 'NoMbufs': no_mbufs, + 'iErrMiss': errors} + self.post_data('rapid_corestatstest', variables) if machines_to_go == 0: duration = duration - 1 machines_to_go = len (self.machines) |