From 7c31f36447aa16122ff4b6d1706f7f134d61c1f5 Mon Sep 17 00:00:00 2001 From: Luc Provoost Date: Wed, 15 Jul 2020 13:51:02 +0200 Subject: 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 --- .../helper-scripts/rapid/rapid_corestatstest.py | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/rapid_corestatstest.py') diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_corestatstest.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_corestatstest.py index dddd29c6..6b9fdcf3 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_corestatstest.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_corestatstest.py @@ -27,14 +27,12 @@ class CoreStatsTest(RapidTest): """ Class to manage the corestatstesting """ - def __init__(self, test_param, runtime, pushgateway, environment_file, machines): - super().__init__(test_param, runtime, pushgateway, environment_file) + def __init__(self, test_param, runtime, testname, environment_file, + machines): + super().__init__(test_param, runtime, testname, environment_file) self.machines = machines def run(self): - # fieldnames = ['PROXID','Time','Received','Sent','NonDPReceived','NonDPSent','Delta','NonDPDelta','Dropped'] - # writer = csv.DictWriter(data_csv_file, fieldnames=fieldnames) - # writer.writeheader() RapidLog.info("+------------------------------------------------------------------------------------------------------------------+") RapidLog.info("| Measuring core statistics on 1 or more PROX instances |") RapidLog.info("+-----------+-----------+------------+------------+------------+------------+------------+------------+------------+") @@ -73,15 +71,16 @@ class CoreStatsTest(RapidTest): old_tsc[i] = new_tsc[i] tot_drop[i] = tot_drop[i] + tx - rx RapidLog.info('|{:>10.0f}'.format(i)+ ' |{:>10.0f}'.format(duration)+' | ' + '{:>10.0f}'.format(rx) + ' | ' +'{:>10.0f}'.format(tx) + ' | '+'{:>10.0f}'.format(non_dp_rx)+' | '+'{:>10.0f}'.format(non_dp_tx)+' | ' + '{:>10.0f}'.format(tx-rx) + ' | '+ '{:>10.0f}'.format(non_dp_tx-non_dp_rx) + ' | '+'{:>10.0f}'.format(tot_drop[i]) +' |') - # writer.writerow({'PROXID':i,'Time':duration,'Received':rx,'Sent':tx,'NonDPReceived':non_dp_rx,'NonDPSent':non_dp_tx,'Delta':tx-rx,'NonDPDelta':non_dp_tx-non_dp_rx,'Dropped':tot_drop[i]}) - if self.test['pushgateway']: - URL = self.test['pushgateway'] + self.test['test']+ '/instance/' + self.test['environment_file'] + str(i) - DATA = 'PROXID {}\nTime {}\n Received {}\nSent {}\nNonDPReceived {}\nNonDPSent {}\nDelta {}\nNonDPDelta {}\nDropped {}\n'.format(i,duration,rx,tx,non_dp_rx,non_dp_tx,tx-rx,non_dp_tx-non_dp_rx,tot_drop[i]) - 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, + 'NonDPReceived': non_dp_rx, + 'NonDPSent': non_dp_tx, + 'Dropped': tot_drop[i]} + self.post_data('rapid_corestatstest', variables) if machines_to_go == 0: duration = duration - 1 machines_to_go = len (self.machines) -- cgit 1.2.3-korg