]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnutls-cli: improved output of --benchmark-tls-kx
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 5 Dec 2019 10:40:31 +0000 (11:40 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 20 Dec 2019 19:52:40 +0000 (20:52 +0100)
It is now printed in a way that separates the tests. Example:
```
(TLS1.3)-(ECDHE-SECP256R1)-(RSA-PSS-RSAE-SHA256)-(AES-128-GCM)
 - 179.19 transactions/sec
 - avg. handshake time: 5.57 ms
 - standard deviation: 0.57

(TLS1.3)-(ECDHE-X25519)-(RSA-PSS-RSAE-SHA256)-(AES-128-GCM)
 - 182.24 transactions/sec
 - avg. handshake time: 5.48 ms
 - standard deviation: 0.64
```

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
src/benchmark-tls.c

index a9c4ce02db7276f8ab75f630990a96470794e4b0..9df0102cfeeb181e8b0c44a394dfb4b2cfcbd3f7 100644 (file)
@@ -508,7 +508,7 @@ static void test_ciphersuite_kx(const char *cipher_prio, unsigned pk)
        }
        while (benchmark_must_finish == 0);
 
-       fprintf(stdout, "%38s  ", suite);
+       fprintf(stdout, "%s\n - ", suite);
        gnutls_free(suite);
        stop_benchmark(&st, "transactions", 1);
        gnutls_priority_deinit(priority_cache);
@@ -531,8 +531,8 @@ static void test_ciphersuite_kx(const char *cipher_prio, unsigned pk)
 
        svar = calc_svar(total_diffs, total_diffs_size, avg);
 
-       printf("%32s %.2f %s, standard deviation: %.2f)\n",
-              "(avg. handshake time:", avg, scale, sqrt(svar));
+       printf(" - avg. handshake time: %.2f %s\n - standard deviation: %.2f %s\n\n",
+              avg, scale, sqrt(svar), scale);
 
        gnutls_anon_free_client_credentials(c_anoncred);
        gnutls_anon_free_server_credentials(s_anoncred);