[riot-notifications] [RIOT-OS/RIOT] test_utils: add UDP benchmark (#16710)

Karl Fessel notifications at github.com
Thu Sep 2 22:20:30 CEST 2021


@kfessel commented on this pull request.



> +### Usage
+
+### Server
+
+Run the binary you find in `bin/benchmark_server`.
+
+e.g. to listen on all addresses on port 12345 run
+
+    bin/benchmark_server :: 12345
+
+There are a few command line options available:
+
+ - `-i <interval>` to control the send interval in µs
+ - `-s <size>` to control the test packet payload
+ - `-o` for one-way mode where only the clients send packets to the server, but the server doesn't echo them back.
+

some clarification for the Readme
since the last configuration package ~= messurement periode
```suggestion

Output:

 - 'host': client address
 - 'bandwith': average bandwith since the last configuration package
 - 'num TX': number of packaged produced by the client since the configuration package
 - 'num RX': number of packaged received by the server since the configuration package
 - 'num RT': number of server echos received by the client since the last configuration package
 - 'RTT':      round trip time client->server->client (last package received by client)

```




> +
+static uint64_t _tv_diff_msec(struct timeval *a, struct timeval *b)
+{
+    return (a->tv_sec - b->tv_sec) * MS_PER_SEC
+         + (a->tv_usec - b->tv_usec) / US_PER_MS;
+}
+
+static void _print_stats(list_node_t *head, struct timeval *now)
+{
+    static uint8_t max_addr_len;
+
+    printf("host%*s\tbandwith\tnum TX\tnum RX",  max_addr_len - 4, "");
+    if (!one_way) {
+        printf("\t\tnum RT\t\tRTT");
+    }
+    puts("");

```suggestion
    printf("\tpkg size\n");
```

> +        unsigned success_rate = node->count_tx
+                              ? (100 * node->count_rx) / node->count_tx
+                              : 0;
+
+        printf("%*s\t%4u b/s\t%u\t%u (%u%%)",
+                                max_addr_len - addr_len, "",
+                                bw,
+                                node->count_tx, node->count_rx,
+                                success_rate);
+        if (!one_way) {
+            unsigned success_rate_rt = node->count_tx
+                                     ? (100 * node->count_rt) / node->count_tx
+                                     : 0;
+            printf("\t%u (%u%%)\t%u µs", node->count_rt, success_rate_rt, node->rtt_us);
+        }
+        puts("");

```suggestion
       printf("\t%zu\n",node->packet_len );
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16710#pullrequestreview-745475362
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210902/1d4132ff/attachment-0001.htm>


More information about the notifications mailing list