Esempio n. 1
0
        /// <summary>
        /// collects and returns information that get displayed by the Client Console
        /// </summary>
        /// <returns></returns>
        public StatusCommons GetStatusForClientConsole()
        {
            StatusCommons st = new StatusCommons();

            st.ClientGuid = slave.Id;

            st.Status         = WcfService.Instance.ConnState;
            st.ConnectedSince = WcfService.Instance.ConnectedSince;

            st.TotalCores = slave.Cores.HasValue ? slave.Cores.Value : 0;
            st.FreeCores  = GetFreeCores();
            st.Asleep     = this.Asleep;

            st.JobsStarted  = SlaveStatusInfo.TasksStarted;
            st.JobsAborted  = SlaveStatusInfo.TasksAborted;
            st.JobsFinished = SlaveStatusInfo.TasksFinished;
            st.JobsFetched  = SlaveStatusInfo.TasksFetched;
            st.JobsFailed   = SlaveStatusInfo.TasksFailed;

            st.Jobs = jobManager.GetExecutionTimes().Select(x => new TaskStatus {
                TaskId = x.Key, ExecutionTime = x.Value
            }).ToList();

            return(st);
        }
Esempio n. 2
0
 public void StatusChanged(StatusCommons status) {
   try {
     ClientCom.StatusChanged(status);
   }
   catch (Exception ex) {
     EventLogManager.LogMessage("Exception on StatusChanged: " + ex.ToString());
   }
 }
Esempio n. 3
0
 public void StatusChanged(StatusCommons status)
 {
     try {
         ClientCom.StatusChanged(status);
     }
     catch (Exception ex) {
         EventLogManager.LogMessage("Exception on StatusChanged: " + ex.ToString());
     }
 }
 public void StatusChanged(StatusCommons status) {
   try {
     subscribers.ForEach(delegate(ISlaveCommunicationCallbacks callback) {
       if (((ICommunicationObject)callback).State == CommunicationState.Opened) {
         callback.OnStatusChanged(status);
       } else {
         subscribers.Remove(callback);
       }
     });
   }
   catch (Exception ex) {
     EventLogManager.LogException(ex);
   }
 }
 public void StatusChanged(StatusCommons status)
 {
     try {
         subscribers.ForEach(delegate(ISlaveCommunicationCallbacks callback) {
             if (((ICommunicationObject)callback).State == CommunicationState.Opened)
             {
                 callback.OnStatusChanged(status);
             }
             else
             {
                 subscribers.Remove(callback);
             }
         });
     }
     catch (Exception ex) {
         EventLogManager.LogException(ex);
     }
 }
Esempio n. 6
0
    /// <summary>
    /// collects and returns information that get displayed by the Client Console
    /// </summary>
    /// <returns></returns>
    public StatusCommons GetStatusForClientConsole() {
      StatusCommons st = new StatusCommons();
      st.ClientGuid = slave.Id;

      st.Status = WcfService.Instance.ConnState;
      st.ConnectedSince = WcfService.Instance.ConnectedSince;

      st.TotalCores = slave.Cores.HasValue ? slave.Cores.Value : 0;
      st.FreeCores = GetFreeCores();
      st.Asleep = this.Asleep;

      st.JobsStarted = SlaveStatusInfo.TasksStarted;
      st.JobsAborted = SlaveStatusInfo.TasksAborted;
      st.JobsFinished = SlaveStatusInfo.TasksFinished;
      st.JobsFetched = SlaveStatusInfo.TasksFetched;
      st.JobsFailed = SlaveStatusInfo.TasksFailed;

      st.Jobs = jobManager.GetExecutionTimes().Select(x => new TaskStatus { TaskId = x.Key, ExecutionTime = x.Value }).ToList();

      return st;
    }