Example #1
0
        public Measurement RunIteration(IterationData data)
        {
            // Initialization
            long invokeCount     = data.InvokeCount;
            int  unrollFactor    = data.UnrollFactor;
            long totalOperations = invokeCount * OperationsPerInvoke;
            var  action          = data.IterationMode.IsIdle() ? IdleAction : MainAction;

            // Setup
            SetupAction?.Invoke();
            GcCollect();

            // Measure
            var clock = TargetJob.Infrastructure.Clock.Resolve(Resolver).Start();

            action(invokeCount / unrollFactor);
            var clockSpan = clock.Stop();

            // Cleanup
            CleanupAction?.Invoke();
            GcCollect();

            // Results
            var measurement = new Measurement(0, data.IterationMode, data.Index, totalOperations, clockSpan.GetNanoseconds());

            WriteLine(measurement.ToOutputLine());
            return(measurement);
        }
Example #2
0
 private void Jitting()
 {
     SetupAction?.Invoke();
     MainAction.Invoke(1);
     IdleAction.Invoke(1);
     CleanupAction?.Invoke();
 }
Example #3
0
 public override void Setup(BizTalkManager manager, Uri moxyUri)
 {
     if (SetupAction == null)
     {
         throw new InvalidOperationException("The Setup action has not been configured for this Send Stop.");
     }
     SetupAction.Invoke(manager, moxyUri);
     base.Setup(manager, moxyUri);
 }