internal void AddMeasurement(IIncomingStep step, TimeSpan elapsed) { var correctedElapsed = Correct(elapsed); var stepType = step.GetType(); var measurement = new Measurement(stepType, correctedElapsed); _measurements.Push(measurement); }
/// <summary> /// Configures injection of the given <see cref="IIncomingStep"/>, positioning it relative to another step /// specified by <paramref name="anchorStep"/>. The relative position is specified with either /// <see cref="PipelineRelativePosition.Before"/> or <see cref="PipelineRelativePosition.After"/> /// </summary> public PipelineStepInjector OnReceive(IIncomingStep step, PipelineRelativePosition position, Type anchorStep) { if (step == null) throw new ArgumentNullException(nameof(step)); if (anchorStep == null) throw new ArgumentNullException(nameof(anchorStep)); _incomingInjectedSteps .GetOrAdd(anchorStep, _ => new List<Tuple<PipelineRelativePosition, IIncomingStep>>()) .Add(Tuple.Create(position, step)); return this; }
/// <summary> /// Sets the specified receive <paramref name="step"/> to be concatenated at the position specified by <paramref name="position"/> /// </summary> public PipelineStepConcatenator OnReceive(IIncomingStep step, PipelineAbsolutePosition position) { if (position == PipelineAbsolutePosition.Front) { _incomingFrontSteps.Add(step); } else { _incomingBackSteps.Add(step); } return this; }
/// <summary> /// Sets the specified receive <paramref name="step"/> to be concatenated at the position specified by <paramref name="position"/> /// </summary> public PipelineStepConcatenator OnReceive(IIncomingStep step, PipelineAbsolutePosition position) { if (position == PipelineAbsolutePosition.Front) { _incomingFrontSteps.Add(step); } else { _incomingBackSteps.Add(step); } return(this); }
/// <summary> /// Sets the specified receive <paramref name="step"/> to be concatenated at the position specified by <paramref name="position"/> /// </summary> public PipelineStepConcatenator OnReceive(IIncomingStep step, PipelineAbsolutePosition position) { if (step == null) throw new ArgumentNullException(nameof(step)); if (position == PipelineAbsolutePosition.Front) { _incomingFrontSteps.Add(step); } else { _incomingBackSteps.Add(step); } return this; }
public static OptionsConfigurer RegisterIncomingStep(this OptionsConfigurer configurer, IIncomingStep stepToInject, PipelineRelativePosition position = PipelineRelativePosition.Before, Type anchorStep = null) { anchorStep = anchorStep ?? typeof(DispatchIncomingMessageStep); configurer.Decorate <IPipeline>(c => { var pipeline = c.Get <IPipeline>(); return(new PipelineStepInjector(pipeline) .OnReceive(stepToInject, position, anchorStep)); }); return(configurer); }
/// <summary> /// Sets the specified receive <paramref name="step"/> to be concatenated at the position specified by <paramref name="position"/> /// </summary> public PipelineStepConcatenator OnReceive(IIncomingStep step, PipelineAbsolutePosition position) { if (step == null) { throw new ArgumentNullException(nameof(step)); } if (position == PipelineAbsolutePosition.Front) { _incomingFrontSteps.Add(step); } else { _incomingBackSteps.Add(step); } return(this); }
static void AddRebusWithStep(IServiceCollection serviceCollection, IIncomingStep step) { serviceCollection.AddRebus(configure => configure .Transport(t => t.UseInMemoryTransport(new InMemNetwork(), "whatever")) .Options(o => { o.Decorate <IPipeline>(c => { var pipeline = c.Get <IPipeline>(); return(new PipelineStepInjector(pipeline) .OnReceive(step, PipelineRelativePosition.After, typeof(SimpleRetryStrategyStep))); }); o.LogPipeline(verbose: true); })); }
public async Task TakeTime(IIncomingStep step) { const int count = 1000000; //const int count = 1000; var stopwatch = Stopwatch.StartNew(); await Task.WhenAll(Enumerable.Range(0, count).Select(GetIncomingStepContext) .Select(context => step.Process(context, Noop))); var elapsed = stopwatch.Elapsed; Console.WriteLine($@" Step: {step} Invocations: {count} Elapsed: {elapsed.TotalSeconds:0.0} "); }
public ProfilerStep(IIncomingStep nextStep) { _nextStep = nextStep; }
/// <summary> /// Adds a new incoming step to the receive pipeline /// </summary> public DefaultPipeline OnReceive(IIncomingStep step) { _receiveSteps.Add(step); return this; }
public StatsContextDisposable(StatsContext statsContext, IIncomingStep nextStep) { _statsContext = statsContext; _nextStep = nextStep; }
internal IDisposable Measure(IIncomingStep nextStep) { return(new StatsContextDisposable(this, nextStep)); }
/// <summary> /// Adds a new incoming step to the receive pipeline /// </summary> public DefaultPipeline OnReceive(IIncomingStep step) { _receiveSteps.Add(step); return(this); }
bool HasMatch(IIncomingStep step) { return(_incomingStepPredicates.Any(p => p(step))); }
internal IDisposable Measure(IIncomingStep nextStep) => new StatsContextDisposable(this, nextStep);
/// <summary> /// Configures injection of the given <see cref="IIncomingStep"/>, positioning it relative to another step /// specified by <paramref name="anchorStep"/>. The relative position is specified with either /// <see cref="PipelineRelativePosition.Before"/> or <see cref="PipelineRelativePosition.After"/> /// </summary> public PipelineStepInjector OnReceive(IIncomingStep step, PipelineRelativePosition position, Type anchorStep) { if (step == null) throw new ArgumentNullException("step"); if (anchorStep == null) throw new ArgumentNullException("anchorStep"); _incomingInjectedSteps .GetOrAdd(anchorStep, _ => new List<Tuple<PipelineRelativePosition, IIncomingStep>>()) .Add(Tuple.Create(position, step)); return this; }
internal IDisposable Measure(IIncomingStep nextStep) { return new StatsContextDisposable(this, nextStep); }
bool HasMatch(IIncomingStep step) { return _incomingStepPredicates.Any(p => p(step)); }
public IncomingPipeline Register(IIncomingStep step) { registeredSteps.Enqueue(step); return this; }