//---------------------------------------------------------------------------------------// /// <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); }
//-------------------------------------------------------------------------------------------------// public WaitEstimate GetEffectiveQueueLength(string userGroup, int priorityHint) { WaitEstimate waitEstimate = null; lock (this.managerLock) { // // NOTE: This implementation does not consider the group or priority of the user // // Get queue wait estimate waitEstimate = this.experimentQueue.GetWaitEstimate(); // Add in time remaining before the next experiment can run LabExperimentStatus labExperimentStatus = this.GetLabExperimentStatus(0, null); waitEstimate.estWait += labExperimentStatus.statusReport.estRemainingRuntime; } return(waitEstimate); }