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"); }
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)); } }
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); }