X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=utils%2Fdashboard%2Fuploader.py;h=97ffd38cea3f790c68232bab012e957913c54f78;hb=07b553641c1f5991191eb4efcb238cd819f7f6a8;hp=07862fed2303135d0d6fa186bfc7e130ebed5c77;hpb=7f3a6fc12fd9f4195c13f6611e83a1f8ff7cbed1;p=bottlenecks.git diff --git a/utils/dashboard/uploader.py b/utils/dashboard/uploader.py index 07862fed..97ffd38c 100755 --- a/utils/dashboard/uploader.py +++ b/utils/dashboard/uploader.py @@ -29,7 +29,6 @@ class Uploader(object): self.result['version'] = dashboard_conf['version'] self.target = dashboard_conf['target'] - def upload_result(self, case_name, raw_data): if self.target == '': print('No target was set, so no data will be posted.') @@ -43,22 +42,25 @@ class Uploader(object): data=json.dumps(self.result), headers=self.headers, timeout=self.timeout) - print('Test result posting finished with status code %d.' % res.status_code) + print( + 'Test result posting finished with status code %d.' % + res.status_code) except Exception as err: print ('Failed to record result data: %s', err) def _test(): - #data = '{"details": [{"client": 200, "throughput": 20}, {"client": 300, "throughput": 20}], "case_name": "rubbos"}' + # data = '{"details": [{"client": 200, "throughput": 20}, + # {"client": 300, "throughput": 20}], "case_name": "rubbos"}' if len(sys.argv) < 2: print ("no argumens input!!") exit(1) - with open(sys.argv[1],'r') as stream: + with open(sys.argv[1], 'r') as stream: data = json.load(stream) Uploader().upload_result(data) + if __name__ == "__main__": _test() -