From 4d8ac95d095cd28731fd7a67d255dd6e16f77c55 Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Fri, 23 Jul 2021 15:16:36 +0200 Subject: [PATCH] Adding docs --- scripts/stream_throughput.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/stream_throughput.py b/scripts/stream_throughput.py index 4ba58bb..5d6aa16 100644 --- a/scripts/stream_throughput.py +++ b/scripts/stream_throughput.py @@ -14,6 +14,11 @@ import logging # Representation of a single data batch transmitted by Stabilizer. Packet = collections.namedtuple('Packet', ['index', 'data']) +# Specifies a known format for incoming packets. +# +# * `sample_size_bytes` is the number of bytes required for each sample in the batch. +# * `batch_format` is a `struct` format string that will be provided the `batch_size` as an named +# argument. This format string will be used to deserialize each batch of data from the frame. Format = collections.namedtuple('Format', ['sample_size_bytes', 'batch_format']) # All supported formats by this reception script. @@ -158,7 +163,7 @@ def main(): while True: # Receive any data over UDP and parse it. - data = connection.recv(4096 * 4) + data = connection.recv(4096) if data and not timer.is_started(): timer.start()