LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File 0554-ssh-Invert-ssh_bench.patch of Package erlang (Project home:Ledest:erlang:20)

From 9b0256865cf2b469311c6a4d56c8233df38b5825 Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Thu, 17 Jan 2019 15:52:21 +0100
Subject: [PATCH 1/3] ssh: Invert ssh_bench

---
 lib/ssh/test/ssh_bench_SUITE.erl | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/ssh/test/ssh_bench_SUITE.erl b/lib/ssh/test/ssh_bench_SUITE.erl
index 764c52b624..5d8ea240bb 100644
--- a/lib/ssh/test/ssh_bench_SUITE.erl
+++ b/lib/ssh/test/ssh_bench_SUITE.erl
@@ -109,10 +109,11 @@ connect(Config) ->
     lists:foreach(
       fun(KexAlg) ->
               PrefAlgs = preferred_algorithms(KexAlg),
-              report([{value, measure_connect(Config,
-                                              [{preferred_algorithms,PrefAlgs}])},
+              report([{value, 1000000 /
+                           measure_connect(Config,
+                                           [{preferred_algorithms,PrefAlgs}])},
                       {suite, ?MODULE},
-                      {name, mk_name(["Connect erlc erld ",KexAlg," [µs]"])}
+                      {name, mk_name(["Connect erlc erld ",KexAlg," [connects/sec]"])}
                      ])
       end, KexAlgs).
 
@@ -130,7 +131,7 @@ measure_connect(Config, Opts) ->
       [begin
            {Time, {ok,Pid}} = timer:tc(ssh,connect,["localhost", Port, ConnectOptions]),
            ssh:close(Pid),
-           Time
+           Time % in µs
        end || _ <- lists:seq(1,?Nruns)]).
 
 %%%----------------------------------------------------------------
@@ -221,9 +222,9 @@ connect_measure(Port, Cipher, Mac, Data, Options) ->
              Time
          end || _ <- lists:seq(1,?Nruns)],
     
-    report([{value, median(Times)},
+    report([{value, 1000000 / median(Times)}, % Time in µs
             {suite, ?MODULE},
-            {name, mk_name(["Transfer 1M bytes ",Cipher,"/",Mac," [µs]"])}]).
+            {name, mk_name(["Transfer ",Cipher,"/",Mac," [Mbyte/s]"])}]).
 
 send_wait_acc(C, Ch, Data) ->
     ssh_connection:send(C, Ch, Data),
-- 
2.16.4