Ejemplo n.º 1
0
 public void PerformaceUpdate(PerformanceUpdateMessage message)
 {
     foreach (KeyValuePair <string, RCProcess.SPerformance> keyValuePair in message.Performance)
     {
         RCProcess rcprocess = this._processCollection[keyValuePair.Key];
         if (rcprocess != null)
         {
             rcprocess.UpdatePerformance(keyValuePair.Value.PrivateMemorySize, keyValuePair.Value.VirtualMemorySize, keyValuePair.Value.CPU);
         }
     }
 }
Ejemplo n.º 2
0
 private void ReportPerformance(RCClient client)
 {
     if (this.performanceScheduled)
     {
         PerformanceUpdateMessage performanceUpdateMessage = null;
         foreach (RCProcess rcprocess in client.ProcessList)
         {
             if (rcprocess.CanQueryPerformance() && rcprocess.QueryPerformance())
             {
                 if (performanceUpdateMessage == null)
                 {
                     performanceUpdateMessage = new PerformanceUpdateMessage();
                 }
                 performanceUpdateMessage.Add(rcprocess.Name, rcprocess.Performance);
             }
         }
         if (performanceUpdateMessage != null)
         {
             this.Send <PerformanceUpdateMessage>(performanceUpdateMessage);
         }
         Scheduler.Schedule(this.Thread, Job.Create <RCClient>(new Action <RCClient>(this.ReportPerformance), client), 15000);
     }
 }