diff options
author | Håvard Pettersen <havardpe@oath.com> | 2021-06-02 12:26:46 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2021-06-02 12:26:46 +0000 |
commit | 15f10b8cc0e16acd28dc28d387625a4769509b67 (patch) | |
tree | f67b7a2c70ff3a788d41db2fc737d3e4db088d95 /jrt/tests | |
parent | 48b61eb09f817c0f4153ad8d0989695f6758cff8 (diff) |
drop empty buffers support for Java
Diffstat (limited to 'jrt/tests')
-rw-r--r-- | jrt/tests/com/yahoo/jrt/LatencyTest.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/jrt/tests/com/yahoo/jrt/LatencyTest.java b/jrt/tests/com/yahoo/jrt/LatencyTest.java index c8ead8ebf77..1c736fb28ea 100644 --- a/jrt/tests/com/yahoo/jrt/LatencyTest.java +++ b/jrt/tests/com/yahoo/jrt/LatencyTest.java @@ -17,12 +17,15 @@ public class LatencyTest { private final Supervisor server; private final Supervisor client; private final Acceptor acceptor; - public Network(CryptoEngine crypto, int threads) throws ListenFailedException { + public Network(CryptoEngine crypto, int threads, boolean dropEmpty) throws ListenFailedException { server = new Supervisor(new Transport("server", crypto, threads)); client = new Supervisor(new Transport("client", crypto, threads)); + server.setDropEmptyBuffers(dropEmpty); + client.setDropEmptyBuffers(dropEmpty); server.addMethod(new Method("inc", "i", "i", this::rpc_inc)); acceptor = server.listen(new Spec(0)); } + public Network(CryptoEngine crypto, int threads) throws ListenFailedException { this(crypto, threads, false); } public Target connect() { return client.connect(new Spec("localhost", acceptor.port())); } @@ -188,6 +191,13 @@ public class LatencyTest { } @org.junit.Test + public void testTlsCryptoWithDropEmptyBuffersLatency() throws Throwable { + try (Network network = new Network(new TlsCryptoEngine(createTestTlsContext()), 1, true)) { + new Client(false, network, 1).measureLatency("[tls crypto, drop empty, no reconnect] "); + } + } + + @org.junit.Test public void testTransportThreadScaling() throws Throwable { try (Network network = new Network(new NullCryptoEngine(), 1)) { new Client(false, network, 64).measureLatency("[64 clients, 1/1 transport] "); |