예제 #1
0
        public WaitEstimate GetEffectiveQueueLength(string userGroup, int priorityHint)
        {
            const string STRLOG_MethodName = "GetEffectiveQueueLength";

            Logfile.WriteCalled(null, STRLOG_MethodName);

            WaitEstimate waitEstimate = null;

            // Get the identity of the caller
            string sbName = GetCallerName(authHeader);

            // Check caller access is authorised
            if (sbName != null)
            {
                // Pass on to experiment manager
                waitEstimate = Global.experimentManager.GetEffectiveQueueLength(userGroup, priorityHint);
            }
            else
            {
                waitEstimate = new WaitEstimate();
            }

            Logfile.WriteCompleted(STRLOG_ClassName, STRLOG_MethodName);

            return(waitEstimate);
        }
예제 #2
0
        //-------------------------------------------------------------------------------------------------//

        protected void btnRefresh_Click1(object sender, EventArgs e)
        {
            //
            // Get the LabServer status and display
            //
            try
            {
                LabStatus labStatus = Master.ServiceBroker.GetLabStatus();
                if (labStatus.online == true)
                {
                    //
                    // Display lab status
                    //
                    lblOnline.ForeColor = Color.Green;
                    lblOnline.Text      = STR_Online;

                    //
                    // Display the queue length and wait time
                    //
                    WaitEstimate waitEstimate = Master.ServiceBroker.GetEffectiveQueueLength();
                    lblLabServerStatusMsg.Text = labStatus.labStatusMessage + STR_Spacer +
                                                 this.FormatQueueLengthWait(waitEstimate.effectiveQueueLength, (int)waitEstimate.estWait);
                }
                else
                {
                    //
                    // Display lab status and message
                    //
                    lblOnline.ForeColor        = Color.Red;
                    lblOnline.Text             = STR_Offline;
                    lblLabServerStatusMsg.Text = labStatus.labStatusMessage;
                }
            }
            catch (Exception ex)
            {
                // LabServer error
                Logfile.WriteError(ex.Message);
                lblLabServerStatusMsg.Text = STRERR_GetExperimentStatusFailed;
            }
        }
        //-------------------------------------------------------------------------------------------------//
        private WaitEstimate ConvertType(Proxy.WaitEstimate proxyWaitEstimate)
        {
            WaitEstimate waitEstimate = null;

            if (proxyWaitEstimate != null)
            {
                waitEstimate = new WaitEstimate();
                waitEstimate.EffectiveQueueLength = proxyWaitEstimate.effectiveQueueLength;
                waitEstimate.EstimatedWait = proxyWaitEstimate.estWait;
            }

            return waitEstimate;
        }
        public WaitEstimate GetEffectiveQueueLength(string userGroup, int priorityHint)
        {
            const string STRLOG_MethodName = "GetEffectiveQueueLength";

            Logfile.WriteCalled(null, STRLOG_MethodName);

            WaitEstimate waitEstimate = null;

            // Get the identity of the caller
            string sbName = GetCallerName(authHeader);

            // Check caller access is authorised
            if (sbName != null)
            {
                // Pass on to experiment manager
                waitEstimate = Global.experimentManager.GetEffectiveQueueLength(userGroup, priorityHint);
            }
            else
            {
                waitEstimate = new WaitEstimate();
            }

            Logfile.WriteCompleted(STRLOG_ClassName, STRLOG_MethodName);

            return waitEstimate;
        }
        //---------------------------------------------------------------------------------------//
        /// <summary>
        /// Get the length of the queue and estimated queue wait time.
        /// </summary>
        /// <returns></returns>
        public WaitEstimate GetWaitEstimate()
        {
            const string STRLOG_MethodName = "GetWaitEstimate";

            Logfile.WriteCalled(STRLOG_ClassName, STRLOG_MethodName);

            WaitEstimate waitEstimate;

            //
            // Get the queued experiment information for non-existent experiment
            //
            QueuedExperimentInfo queuedExperimentInfo = GetQueuedExperimentInfo(0, null);

            //
            // Save the wait estimate information
            //
            if (queuedExperimentInfo != null)
            {
                waitEstimate = new WaitEstimate(queuedExperimentInfo.queueLength, queuedExperimentInfo.waitTime);
            }
            else
            {
                // Should never occur, but anyway...
                waitEstimate = new WaitEstimate();
            }

            Logfile.WriteCompleted(STRLOG_ClassName, STRLOG_MethodName);

            return waitEstimate;
        }