예제 #1
0
        private void RunHandler(EngineBase engine, TimeSpan rampUpDelay)
        {
            LoadTesterActivityController.SetThreadName();

            TraceFactory.Logger.Debug("Pausing for {0} secs".FormatWith(rampUpDelay.TotalSeconds));
            ApplicationFlowControl.Instance.Wait(rampUpDelay);
            TraceFactory.Logger.Debug("Pausing for {0} secs - COMPLETE".FormatWith(rampUpDelay.TotalSeconds));

            engine.Run();

            TraceFactory.Logger.Debug("Engine run complete");
        }
예제 #2
0
        private void HaltHandler(LoadTestThread activity)
        {
            LoadTesterActivityController.SetThreadName();

            if (activity.Task.Status == TaskStatus.Running)
            {
                TraceFactory.Logger.Debug("Halting task {0}".FormatWith(activity.Task.Id));
                activity.Engine.Halt();
            }
            else
            {
                TraceFactory.Logger.Debug("Task {0} is not running".FormatWith(activity.Task.Id));
            }
        }
예제 #3
0
        private void ExecuteTasks()
        {
            LoadTesterActivityController.SetThreadName();

            TraceFactory.Logger.Debug("Starting parallel execution of all tasks");

            // Spin up each thread in parallel to get them all started at about the same time.
            foreach (var thread in _threads)
            {
                thread.Task.Start();
            }

            // Wait for all the tasks to complete before proceeding
            Task.WaitAll(_threads.Select(x => x.Task).ToArray());

            TraceFactory.Logger.Debug("ALL TASKS COMPLETE");
            SessionProxyBackendConnection.ChangeResourceState(RuntimeState.Completed);
        }