Beispiel #1
0
        public IterationResult(IIterationResult iteration, IThreadPoolStats threadPoolContext)
        {
            ThreadId          = iteration.ThreadId;
            GlobalIterationId = iteration.GlobalIterationId;
            ThreadIterationId = iteration.ThreadIterationId;
            UserData          = iteration.UserData;


            IterationStarted  = iteration.IterationStarted;
            IterationFinished = iteration.IterationFinished;

            CreatedThreads = threadPoolContext.InitializedThreadCount;
            IdleThreads    = threadPoolContext.IdleThreadCount;

            Checkpoints = iteration.CopyCheckpoints();
        }
        public void HeartBeat(ITestState state)
        {
            if (_batchState == BatchState.Waiting)
            {
                IThreadPoolStats pool = state.ThreadPool;

                if (pool.CreatedThreadCount == pool.IdleThreadCount && pool.CreatedThreadCount >= _batchSize)
                {
                    _executedInBatch = 0;
                    _executeAt       = state.Timer.Value.Add(ExecuteDelay);
                    _batchState      = BatchState.Executing;
                }
            }
            else if (_executedInBatch >= _batchSize)
            {
                _batchState = BatchState.Waiting;
            }
        }
Beispiel #3
0
        public TestState(ITimer timer, IGlobalCounters counters, IThreadPoolStats threadPool)
        {
            if (timer == null)
            {
                throw new ArgumentNullException(nameof(timer));
            }
            if (counters == null)
            {
                throw new ArgumentNullException(nameof(counters));
            }
            if (threadPool == null)
            {
                throw new ArgumentNullException(nameof(threadPool));
            }

            Timer      = timer;
            Counters   = counters;
            ThreadPool = threadPool;
        }
Beispiel #4
0
        private IDataCollectorFactory CreateDataCollectorFactory(IPipeFactory <IResult> pipeFactory, IThreadPoolStats poolStats)
        {
            IDataCollectorFactory result;

            if (_settings.Aggregators.IsNullOrEmpty())
            {
                result = new NullDataCollectorFactory();
            }
            else
            {
                result = new PipeDataCollectorFactory(pipeFactory, poolStats);
            }

            return(result);
        }
Beispiel #5
0
 public PipeDataCollectorFactory(IPipeFactory <IResult> pipeFactory, IThreadPoolStats counter)
 {
     _pipeFactory = pipeFactory ?? throw new ArgumentNullException(nameof(pipeFactory));
     _counter     = counter ?? throw new ArgumentNullException(nameof(counter));
 }
Beispiel #6
0
 public WorkerThreadStats(IThreadPoolStats reference)
 {
     _createdThreadCount    = reference.CreatedThreadCount;
     _initializedTheadCount = reference.InitializedThreadCount;
     _idleThreadCount       = reference.IdleThreadCount;
 }
 public void Setup(ITestState state)
 {
     _pool = state.ThreadPool;
 }
Beispiel #8
0
 public PipeDataCollector(IProducer <IResult> producer, IIterationResult context, IThreadPoolStats poolStats)
 {
     _producer  = producer ?? throw new ArgumentNullException(nameof(producer));
     _context   = context ?? throw new ArgumentNullException(nameof(context));
     _poolStats = poolStats ?? throw new ArgumentNullException(nameof(poolStats));
 }