From 0b5a47b53160d4c150278b2799192eb3ada8cb2d Mon Sep 17 00:00:00 2001 From: marcsello Date: Fri, 23 Oct 2020 16:51:21 +0200 Subject: [PATCH] Added http time to output --- benchmark3.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/benchmark3.py b/benchmark3.py index 648c1a1..c04a903 100644 --- a/benchmark3.py +++ b/benchmark3.py @@ -148,10 +148,11 @@ def write_results(results, file_handle): # Latency and rtt are in ms writer.writerow( - ['id', 'http_start_time', 'http_complete_time', 'status_code', 'mqtt_arrive_time', 'latency', 'rtt'] + ['id', 'http_start_time', 'http_complete_time', 'http_time', 'status_code', 'mqtt_arrive_time', 'latency', 'rtt'] ) for result in results: + http_time = (result.upload_finished - result.upload_started) * 1000 if result.upload_finished else None latency = (result.alert_arrived - result.upload_finished) * 1000 if result.alert_arrived else None rtt = (result.alert_arrived - result.upload_started) * 1000 if result.alert_arrived else None @@ -159,6 +160,7 @@ def write_results(results, file_handle): result.id, csv_time_format(result.upload_started), csv_time_format(result.upload_finished), + http_time, result.upload_status_code, csv_time_format(result.alert_arrived), latency, @@ -173,6 +175,7 @@ def main(): id - Unique ID of a request (not sequential but at least unique) http_start_time - Timestamp of when the HTTP request is started http_complete_time - Timestamp of when the HTTP request is completed + http_time - Time it took to perform the HTTP request (i.e. Uploading) in milliseconds status_code - Status code of the HTTP request mqtt_arrive_time - Timestamp of when the corresponding MQTT message arrived latency - Latency of the system (http_complete_time - mqtt_arrive_time) in milliseconds