Example #1
0
        public Pipeline3StepLatencyDisruptorPerfTest()
            : base(2 * Million)
        {
            _disruptor = new Disruptor <ValueEvent>(() => new ValueEvent(), Size, TaskScheduler.Default, ProducerType.SINGLE, new YieldingWaitStrategy());

            _mru = new ManualResetEvent(false);
            _stepOneFunctionEventHandler   = new LatencyStepEventHandler(FunctionStep.One, Histogram, StopwatchTimestampCostInNano, TicksToNanos, Iterations, _mru);
            _stepTwoFunctionEventHandler   = new LatencyStepEventHandler(FunctionStep.Two, Histogram, StopwatchTimestampCostInNano, TicksToNanos, Iterations, _mru);
            _stepThreeFunctionEventHandler = new LatencyStepEventHandler(FunctionStep.Three, Histogram, StopwatchTimestampCostInNano, TicksToNanos, Iterations, _mru);

            _disruptor.HandleEventsWith(_stepOneFunctionEventHandler)
            .Then(_stepTwoFunctionEventHandler)
            .Then(_stepThreeFunctionEventHandler);
            _ringBuffer = _disruptor.GetRingBuffer;
        }
        public Pipeline3StepLatencyDisruptorPerfTest()
            : base(2 * Million)
        {
            _disruptor = new Disruptor<ValueEvent>(() => new ValueEvent(), Size, TaskScheduler.Default, ProducerType.SINGLE, new YieldingWaitStrategy());                                                   

            _mru = new ManualResetEvent(false);
            _stepOneFunctionEventHandler = new LatencyStepEventHandler(FunctionStep.One, Histogram, StopwatchTimestampCostInNano, TicksToNanos, Iterations, _mru);
            _stepTwoFunctionEventHandler = new LatencyStepEventHandler(FunctionStep.Two, Histogram, StopwatchTimestampCostInNano, TicksToNanos, Iterations, _mru);
            _stepThreeFunctionEventHandler = new LatencyStepEventHandler(FunctionStep.Three, Histogram, StopwatchTimestampCostInNano, TicksToNanos, Iterations, _mru);

            _disruptor.HandleEventsWith(_stepOneFunctionEventHandler)
                .Then(_stepTwoFunctionEventHandler)
                .Then(_stepThreeFunctionEventHandler);
            _ringBuffer = _disruptor.GetRingBuffer;
        }
        public Pipeline3StepLatencyDisruptorPerfTest()
            : base(2 * Million)
        {
            _disruptor = new Dsl.Disruptor <ValueEvent>(() => new ValueEvent(),
                                                        new SingleThreadedClaimStrategy(Size),
                                                        new YieldingWaitStrategy());

            _mru = new ManualResetEvent(false);
            _stepOneFunctionEventHandler   = new LatencyStepEventHandler(FunctionStep.One, Histogram, StopwatchTimestampCostInNano, TicksToNanos, Iterations, _mru);
            _stepTwoFunctionEventHandler   = new LatencyStepEventHandler(FunctionStep.Two, Histogram, StopwatchTimestampCostInNano, TicksToNanos, Iterations, _mru);
            _stepThreeFunctionEventHandler = new LatencyStepEventHandler(FunctionStep.Three, Histogram, StopwatchTimestampCostInNano, TicksToNanos, Iterations, _mru);

            _disruptor.HandleEventsWith(_stepOneFunctionEventHandler)
            .Then(_stepTwoFunctionEventHandler)
            .Then(_stepThreeFunctionEventHandler);
            _ringBuffer = _disruptor.RingBuffer;
        }
        public Pipeline3StepLatencyDisruptorPerfTest()
            : base(2 * Million)
        {
            _disruptor = new Dsl.Disruptor<ValueEvent>(() => new ValueEvent(),
                                                   new SingleThreadedClaimStrategy(Size),
                                                   new YieldingWaitStrategy());

            _mru = new ManualResetEvent(false);
            _stepOneFunctionEventHandler = new LatencyStepEventHandler(FunctionStep.One, Histogram, StopwatchTimestampCostInNano, TicksToNanos, Iterations, _mru);
            _stepTwoFunctionEventHandler = new LatencyStepEventHandler(FunctionStep.Two, Histogram, StopwatchTimestampCostInNano, TicksToNanos, Iterations, _mru);
            _stepThreeFunctionEventHandler = new LatencyStepEventHandler(FunctionStep.Three, Histogram, StopwatchTimestampCostInNano, TicksToNanos, Iterations, _mru);

            _disruptor.HandleEventsWith(_stepOneFunctionEventHandler)
                .Then(_stepTwoFunctionEventHandler)
                .Then(_stepThreeFunctionEventHandler);
            _ringBuffer = _disruptor.RingBuffer;
        }