Class ExecAndProcessLatencyEngine

    • Constructor Detail

      • ExecAndProcessLatencyEngine

        public ExecAndProcessLatencyEngine()
      • ExecAndProcessLatencyEngine

        public ExecAndProcessLatencyEngine​(SlowExecutorPattern skewedPattern)
    • Method Detail

      • toNano

        public static long toNano​(double ms)
      • prepare

        public void prepare()
      • sleepNano

        public void sleepNano​(long start,
                              long sleepAmount)
        Sleep for a set number of nano seconds.
        Parameters:
        start - the start time of the sleep
        sleepAmount - how many nano seconds after start when we should stop.
      • sleepNano

        public void sleepNano​(long nano)
      • sleepUntilNano

        public void sleepUntilNano​(long endTime)
      • simulateProcessAndExecTime

        public void simulateProcessAndExecTime​(int executorIndex,
                                               long startTimeNs,
                                               InputStream in,
                                               Runnable r)
        Simulate both process and exec times.
        Parameters:
        executorIndex - the index of this executor. It is used to skew the latencies.
        startTimeNs - when the executor started in nano-seconds.
        in - the metrics for the input stream (or null if you don't want to use them).
        r - what to run when the process latency is up. Note that this may run on a separate thread after this method call has completed.