void VirtualResourceEventBus_OnStartMainRun(object sender, VirtualResourceEventBusRunArgs e)
        {
            TraceFactory.Logger.Debug("Attempting to start the Citrix Published Application");

            // Now the actual Citrix published app must be started.
            ChangeMachineStatusMessage("Starting Published App");
            CitrixSessionManager.StartPublishedApp(_credential, _citrixServer, _worker.PublishedApp);

            ChangeResourceState(RuntimeState.Running);
        }
        void VirtualResourceEventBus_OnStartMainRun(object sender, VirtualResourceEventBusRunArgs e)
        {
            TraceFactory.Logger.Debug("Returning a completed signal as the machine is now up and running");

            // There's a bit of a timing problem here.  If the completed is sent back too quickly the
            // state will be changed before the run handler has a chance to set the state to running.
            // So delay for a few seconds so that this update doesn't beat the session proxy Run
            // Handler's update.  Otherwise the state will be left in Running.
            Thread.Sleep(5000);
            ChangeResourceState(RuntimeState.Completed);
        }
        protected virtual void VirtualResourceEventBus_OnStartRun(object sender, VirtualResourceEventBusRunArgs e)
        {
            CurrentPhase = e.Phase;

            TraceFactory.Logger.Debug("UserName: {0}, Phase: {1}".FormatWith(GlobalDataStore.ResourceInstanceId, CurrentPhase));

            if (IsHalted)
            {
                TraceFactory.Logger.Debug("Sending Halted state message");
                ChangeState(RuntimeState.Halted);
            }
            else
            {
                // Notify clients that this resource is now starting
                ChangeState(RuntimeState.Running);
                StartActivities();
            }
        }
Example #4
0
        void VirtualResourceEventBus_OnStartMainRun(object sender, VirtualResourceEventBusRunArgs e)
        {
            var resource = _manifest.Resources.First();

            TraceFactory.Logger.Debug("Metadata count: {0}".FormatWith(resource.MetadataDetails.Count));

            SessionProxyBackendConnection.ChangeResourceState(RuntimeState.Starting);

            foreach (var metadataDetail in resource.MetadataDetails.Cast <LoadTesterMetadataDetail>())
            {
                var plan = metadataDetail.Plan as LoadTesterExecutionPlan;

                if (plan.Mode != ExecutionMode.Poisson)
                {
                    TraceFactory.Logger.Debug("Mode: {0}".FormatWith(plan.RampUpMode));

                    switch (plan.RampUpMode)
                    {
                    case RampUpMode.RateBased:
                        StartWithRateBasedRampUp(metadataDetail);
                        break;

                    case RampUpMode.TimeBased:
                        StartWithTimeBasedRampUp(metadataDetail);
                        break;
                    }
                }
                else
                {
                    Task.Factory.StartNew(() => StartPoissonHandler(metadataDetail));
                }
            }

            // Notify clients that this resource is now running
            SessionProxyBackendConnection.ChangeResourceState(RuntimeState.Running);
        }
        void VirtualResourceEventBus_OnStart(object sender, VirtualResourceEventBusRunArgs e)
        {
            _collector.Start();

            ChangeResourceState(RuntimeState.Running);
        }