Search in sources :

Example 16 with MessageGroup

use of com.ms.silverking.cloud.dht.net.MessageGroup in project SilverKing by Morgan-Stanley.

the class MessageGroupTest method runQueueingConnectionTestClient.

private void runQueueingConnectionTestClient(double durationSeconds) throws IOException {
    MessageGroup msg;
    Stopwatch sw;
    Stopwatch displaySW;
    // msg = createMessage(NumConversion.intToBytes(index));
    sw = new SimpleStopwatch();
    displaySW = new SimpleStopwatch();
    do {
        msg = createMessage(NumConversion.intToBytes(clientPort));
        // System.out.println("Sending");
        messagesSent.incrementAndGet();
        paServer.send(serverAddr, msg, false, Long.MAX_VALUE);
        try {
            semaphore.acquire();
        } catch (InterruptedException ie) {
        }
        // rewindBuffers(msg);
        if (displaySW.getSplitSeconds() > displayIntervalSeconds) {
            displayStats(sw.getSplitSeconds());
            displaySW.reset();
        }
    } while (sw.getSplitSeconds() < durationSeconds);
    sw.stop();
    displayStats(sw.getElapsedSeconds());
}
Also used : MessageGroup(com.ms.silverking.cloud.dht.net.MessageGroup) Stopwatch(com.ms.silverking.time.Stopwatch) SimpleStopwatch(com.ms.silverking.time.SimpleStopwatch) SimpleStopwatch(com.ms.silverking.time.SimpleStopwatch)

Aggregations

MessageGroup (com.ms.silverking.cloud.dht.net.MessageGroup)16 ProtoChecksumTreeRequestMessageGroup (com.ms.silverking.cloud.dht.net.ProtoChecksumTreeRequestMessageGroup)7 ProtoRetrievalMessageGroup (com.ms.silverking.cloud.dht.net.ProtoRetrievalMessageGroup)7 IOException (java.io.IOException)4 ProtoMessageGroup (com.ms.silverking.cloud.dht.net.ProtoMessageGroup)3 RetrievalOptions (com.ms.silverking.cloud.dht.RetrievalOptions)2 DHTKey (com.ms.silverking.cloud.dht.common.DHTKey)2 InternalRetrievalOptions (com.ms.silverking.cloud.dht.common.InternalRetrievalOptions)2 ProtoChecksumTreeMessageGroup (com.ms.silverking.cloud.dht.net.ProtoChecksumTreeMessageGroup)2 UUIDBase (com.ms.silverking.id.UUIDBase)2 ImmutableList (com.google.common.collect.ImmutableList)1 SimpleValueCreator (com.ms.silverking.cloud.dht.common.SimpleValueCreator)1 MessageAndConnection (com.ms.silverking.cloud.dht.daemon.MessageModule.MessageAndConnection)1 RetrievalResult (com.ms.silverking.cloud.dht.daemon.storage.protocol.RetrievalResult)1 MessageGroupRetrievalResponseEntry (com.ms.silverking.cloud.dht.net.MessageGroupRetrievalResponseEntry)1 ProtoKeyedMessageGroup (com.ms.silverking.cloud.dht.net.ProtoKeyedMessageGroup)1 ProtoNopMessageGroup (com.ms.silverking.cloud.dht.net.ProtoNopMessageGroup)1 ProtoOpResponseMessageGroup (com.ms.silverking.cloud.dht.net.ProtoOpResponseMessageGroup)1 ProtoPingAckMessageGroup (com.ms.silverking.cloud.dht.net.ProtoPingAckMessageGroup)1 ProtoPingMessageGroup (com.ms.silverking.cloud.dht.net.ProtoPingMessageGroup)1