Package org.jgroups.tests
Class NioServerPerfTest
- java.lang.Object
-
- org.jgroups.tests.NioServerPerfTest
-
public class NioServerPerfTest extends java.lang.ObjectNIO based server for measuring heap-based vs direct byte buffers. UseNioClientTestas client test driver- Since:
- 3.6.4
-
-
Field Summary
Fields Modifier and Type Field Description protected java.nio.ByteBufferbufferstatic longBYTES_TO_SENDprotected java.nio.channels.ServerSocketChannelchprotected booleanrunningprotected java.nio.channels.Selectorselectorstatic intSIZEprotected java.util.concurrent.atomic.AtomicLongstartprotected java.util.concurrent.atomic.AtomicLongtotal_bytes_receivedprotected java.util.concurrent.atomic.AtomicLongtotal_msgs
-
Constructor Summary
Constructors Constructor Description NioServerPerfTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static java.nio.ByteBuffercreate(int size, boolean direct)protected booleanhandle(java.nio.channels.SocketChannel ch, java.nio.ByteBuffer buf)static voidmain(java.lang.String[] args)protected voidstart(boolean direct)
-
-
-
Field Detail
-
ch
protected java.nio.channels.ServerSocketChannel ch
-
selector
protected java.nio.channels.Selector selector
-
running
protected volatile boolean running
-
buffer
protected java.nio.ByteBuffer buffer
-
total_bytes_received
protected final java.util.concurrent.atomic.AtomicLong total_bytes_received
-
total_msgs
protected final java.util.concurrent.atomic.AtomicLong total_msgs
-
start
protected final java.util.concurrent.atomic.AtomicLong start
-
BYTES_TO_SEND
public static final long BYTES_TO_SEND
- See Also:
- Constant Field Values
-
SIZE
public static final int SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
protected static java.nio.ByteBuffer create(int size, boolean direct)
-
start
protected void start(boolean direct) throws java.lang.Exception- Throws:
java.lang.Exception
-
handle
protected boolean handle(java.nio.channels.SocketChannel ch, java.nio.ByteBuffer buf)
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
-