INNER CODE UNIT · Python
total
open-quantum-safe/oqs-demos · locust/scenarios/locustfile.py:44
total = int((time.time() - start) * 1000)
logger.debug(f"result: {result.stdout}")
response_output = result.stdout
content_length = 0
headers, _, body = response_output.partition("\r\n\r\n")
for line in headers.splitlines():
if line.lower().startswith("content-length:"):
content_length = int(line.split(":")[1].strip())
break
if result.returncode == 0:
logger.debug(f"Request to {endpoint} succeeded")
logger.debug(f"Response:\n{result.stdout}")
self.environment.events.request.fire(
request_type="GET",
name=request_name,
response_time=total,
response_length=content_length,
exception=None,