You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.
Implement bytes throughput and request count throughput metrics in a single test run of an algorithm and its selected amount of iterations.
After calculating the new metrics, you will add them as two new fields to our results JSON, requestThroughput and bytesThroughput, to the existing JSON data structure. These fields will represent the per-second throughput of algorithm executions and data processed respectively.
These new metrics shall also be visualized in the UI.
Current JSON Structure
The current JSON data structure appears as follows:
Data Collection: Per run, we need the number of iterations, the total message size (=iterations * message size), and the total time taken for the test run.
Message Size Calculation: Calculate the size of an HTTP request by adding the size of the request line, headers, and the payload (for POST requests). The size of the request line includes the HTTP method, URL, and HTTP version. Headers include fields like Host, User-Agent, Accept, and others. The payload is the data being sent to the server (for POST requests).
Python snippet:
# Calculate the size of the request line (method + URL + HTTP version)# We add 4 to account for the 3 spaces and 1 end-of-line character that are part of the request linerequest_line_size=sys.getsizeof(method) +sys.getsizeof(url) +sys.getsizeof('HTTP/1.1') +4# Calculate the size of the headersheaders_size=sum(sys.getsizeof(header) forheaderinheaders.values())
# Calculate the size of the payloaddata_size=sys.getsizeof(data)
# Add up the sizes to get the total sizetotal_size=request_line_size+headers_size+data_size
Throughput Calculation: Calculate the throughput per second for iterations and bytes:
For requests count: Throughput in count/second = (Total Count of Requests) / (Total Time in Seconds)
For bytes: Throughput in bytes/second = (Total Data in Bytes) / (Total Time in Seconds)
If the total time is less than a second, the throughput has to be scaled up proportionally to represent an estimate for a full second.
For example, if the total time is 30 seconds (0.5 seconds) and there are 500 requests, the formula becomes 500 / 0.5 resulting in 1000 requests per second.
Field Addition: After calculating the throughput values, add them to the respective JSON objects under the results field as requestThroughput and bytesThroughput.
Metrics in DB: When saving the throughput values, make sure to name the metrics as follows: requestThroughputPerSecond and bytesThroughputSecond.
Visualization: After adding the new fields to the JSON, add the metrics to the UI visualization, both the table and the graphs.
Acceptance Criteria
The size of an HTTP request is correctly calculated by adding the size of the request line, headers, and the payload (for POST requests).
The values for requestThroughput correctly represent the number of iterations that would be completed per second, given the total count of iterations and the total time for the test run. This should be calculated even if the total time is less than a second, in which case the throughput should be scaled up proportionally.
The values for bytesThroughput correctly represent the volume of data that would be processed per second, given the total volume of data and the total time for the test run. This should be calculated even if the total time is less than a second, in which case the throughput should be scaled up proportionally.
The new fields requestThroughput and bytesThroughput are correctly added to the respective JSON objects under the results field.
These new metrics show up in the UI results table, and the graphs.
Overview
Implement bytes throughput and request count throughput metrics in a single test run of an algorithm and its selected amount of iterations.
After calculating the new metrics, you will add them as two new fields to our results JSON,
requestThroughput
andbytesThroughput
, to the existing JSON data structure. These fields will represent the per-second throughput of algorithm executions and data processed respectively.These new metrics shall also be visualized in the UI.
Current JSON Structure
The current JSON data structure appears as follows:
Expected JSON Structure
The proposed JSON structure with the new fields is as follows:
Implementation Steps
Data Collection: Per run, we need the number of iterations, the total message size (=iterations * message size), and the total time taken for the test run.
Message Size Calculation: Calculate the size of an HTTP request by adding the size of the request line, headers, and the payload (for POST requests). The size of the request line includes the HTTP method, URL, and HTTP version. Headers include fields like Host, User-Agent, Accept, and others. The payload is the data being sent to the server (for POST requests).
Python snippet:
Throughput Calculation: Calculate the throughput per second for iterations and bytes:
For requests count:
Throughput in count/second = (Total Count of Requests) / (Total Time in Seconds)
For bytes:
Throughput in bytes/second = (Total Data in Bytes) / (Total Time in Seconds)
If the total time is less than a second, the throughput has to be scaled up proportionally to represent an estimate for a full second.
For example, if the total time is 30 seconds (0.5 seconds) and there are 500 requests, the formula becomes 500 / 0.5 resulting in 1000 requests per second.
Field Addition: After calculating the throughput values, add them to the respective JSON objects under the
results
field asrequestThroughput
andbytesThroughput
.Metrics in DB: When saving the throughput values, make sure to name the metrics as follows:
requestThroughputPerSecond
andbytesThroughputSecond
.Visualization: After adding the new fields to the JSON, add the metrics to the UI visualization, both the table and the graphs.
Acceptance Criteria
The size of an HTTP request is correctly calculated by adding the size of the request line, headers, and the payload (for POST requests).
The values for
requestThroughput
correctly represent the number of iterations that would be completed per second, given the total count of iterations and the total time for the test run. This should be calculated even if the total time is less than a second, in which case the throughput should be scaled up proportionally.The values for
bytesThroughput
correctly represent the volume of data that would be processed per second, given the total volume of data and the total time for the test run. This should be calculated even if the total time is less than a second, in which case the throughput should be scaled up proportionally.The new fields
requestThroughput
andbytesThroughput
are correctly added to the respective JSON objects under theresults
field.These new metrics show up in the UI results table, and the graphs.
Tasks
The text was updated successfully, but these errors were encountered: