// Path: benchmarks-api/src/main/java/uk/co/real_logic/benchmarks/remote/MessageTransceiver.java
// static final long CHECKSUM = ThreadLocalRandom.current().nextLong();


import org.agrona.LangUtil;
import org.agrona.PropertyAction;
import org.agrona.SystemUtil;
import org.agrona.concurrent.IdleStrategy;
import org.agrona.concurrent.NanoClock;
import java.io.PrintStream;
import java.util.concurrent.atomic.AtomicLong;
import static java.lang.Math.min;
import static java.lang.Math.round;
import static java.util.Objects.requireNonNull;
import static java.util.concurrent.TimeUnit.NANOSECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;
import static uk.co.real_logic.benchmarks.remote.MessageTransceiverBase.CHECKSUM;
            histogram.saveToFile(configuration.outputDirectory(), configuration.outputFileNamePrefix());
        }
        finally
        {
            messageTransceiver.destroy();
        }
    }

    @SuppressWarnings("MethodLength")
    long send(final int iterations, final int numberOfMessages)
    {
        final MessageTransceiver messageTransceiver = this.messageTransceiver;
        final NanoClock clock = this.clock;
        final AtomicLong receivedMessages = messageTransceiver.receivedMessages;
        final int burstSize = configuration.batchSize();
        final int messageSize = configuration.messageLength();
        final IdleStrategy idleStrategy = configuration.idleStrategy();
        final long sendIntervalNs = NANOS_PER_SECOND * burstSize / numberOfMessages;
        final long totalNumberOfMessages = (long)iterations * numberOfMessages;

        final long startTimeNs = clock.nanoTime();
        final long endTimeNs = startTimeNs + iterations * NANOS_PER_SECOND;
        long sentMessages = 0;
        long timestampNs = startTimeNs;
        long nowNs = startTimeNs;
        long nextReportTimeNs = startTimeNs + NANOS_PER_SECOND;

        int batchSize = (int)min(totalNumberOfMessages, burstSize);
        while (true)
        {
// Path: benchmarks-api/src/main/java/uk/co/real_logic/benchmarks/remote/MessageTransceiver.java
// static final long CHECKSUM = ThreadLocalRandom.current().nextLong();


// Path: benchmarks-api/src/main/java/uk/co/real_logic/benchmarks/remote/LoadTestRig.java
import org.agrona.LangUtil;
import org.agrona.PropertyAction;
import org.agrona.SystemUtil;
import org.agrona.concurrent.IdleStrategy;
import org.agrona.concurrent.NanoClock;
import java.io.PrintStream;
import java.util.concurrent.atomic.AtomicLong;
import static java.lang.Math.min;
import static java.lang.Math.round;
import static java.util.Objects.requireNonNull;
import static java.util.concurrent.TimeUnit.NANOSECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;
import static uk.co.real_logic.benchmarks.remote.MessageTransceiverBase.CHECKSUM;

            histogram.saveToFile(configuration.outputDirectory(), configuration.outputFileNamePrefix());
        }
        finally
        {
            messageTransceiver.destroy();
        }
    }

    @SuppressWarnings("MethodLength")
    long send(final int iterations, final int numberOfMessages)
    {
        final MessageTransceiver messageTransceiver = this.messageTransceiver;
        final NanoClock clock = this.clock;
        final AtomicLong receivedMessages = messageTransceiver.receivedMessages;
        final int burstSize = configuration.batchSize();
        final int messageSize = configuration.messageLength();
        final IdleStrategy idleStrategy = configuration.idleStrategy();
        final long sendIntervalNs = NANOS_PER_SECOND * burstSize / numberOfMessages;
        final long totalNumberOfMessages = (long)iterations * numberOfMessages;

        final long startTimeNs = clock.nanoTime();
        final long endTimeNs = startTimeNs + iterations * NANOS_PER_SECOND;
        long sentMessages = 0;
        long timestampNs = startTimeNs;
        long nowNs = startTimeNs;
        long nextReportTimeNs = startTimeNs + NANOS_PER_SECOND;

        int batchSize = (int)min(totalNumberOfMessages, burstSize);
        while (true)
        {
            final int sent = messageTransceiver.send(batchSize, messageSize, timestampNs, CHECKSUM);