package net.openhft.chronicle.network;

import net.openhft.chronicle.core.Jvm;

/**
 * Created by peter.lawrey on 16/07/2015.
 */
public enum WanSimulator {
    ;
    private static final int NET_BANDWIDTH = Integer.getInteger("wanMB", 0);
    private static final int BYTES_PER_MS = NET_BANDWIDTH * 1000;
    private static long totalRead = 0;

    public static void dataRead(int bytes) {
        if (NET_BANDWIDTH <= 0) return;
        totalRead += bytes + 128;
        int delay = (int) (totalRead / BYTES_PER_MS);
        if (delay > 0) {
            Jvm.pause(delay);
            totalRead = 0;
        }
    }
}

@@ -73,16 +73,42 @@
 e.Jvm;%0A%0A
+import java.util.Random;%0A%0A
 /**%0A * C
@@ -325,16 +325,71 @@
 * 1000;%0A
+    private static final Random RANDOM = new Random();%0A
     priv
@@ -538,11 +538,36 @@
 s + 
-128
+RANDOM.nextInt(BYTES_PER_MS)
 ;%0A  

Add a wan simulator to reproduce timing sensitive issues with a random 0.5 ms delay.