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); }
public override void Start() { // Open the service endpoint so this resource can receive commands from the dispatcher, // then start the engine controller and then let the dispatcher know that this // resource is ready to run. var name = SystemManifest.Resources.OfType <LoadTesterDetail>().First().Name; ChangeResourceState(RuntimeState.Starting); OpenManagementServiceEndpoint(GlobalDataStore.ResourceInstanceId); TraceFactory.Logger.Debug("Service endpoint opened"); _controller = new LoadTesterActivityController(); _controller.Start(); TraceFactory.Logger.Debug("Load tester activity controller started"); // Register and let the dispatcher know it's available to run. SessionProxyBackendConnection.RegisterResource(ServiceEndpoint); TraceFactory.Logger.Debug("Dispatcher notified that system is ready to start"); }