Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/17/13 15:43:37 (12 years ago)
Author:
pfleck
Message:

#2030
Added MultiSlaveRunner for starting multiple Slave Cores on a single Machine.
Mocked GUID generation for slaves to random GUID.
Deactivated PerformanceCounter measurements from ConfigManager to avoid shared resource locks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HivePerformance/sources/HeuristicLab.Clients.Hive.Slave/3.3/Manager/ConfigManager.cs

    r7857 r9373  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Diagnostics;
    2524using System.Linq;
    2625using System.Management;
     
    4544    private TaskManager jobManager;
    4645    private Slave slave;
    47     private PerformanceCounter cpuCounter;
    48     private PerformanceCounter memCounter;
     46    //private PerformanceCounter cpuCounter;
     47    //private PerformanceCounter memCounter;
    4948
    5049    /// <summary>
     
    5352    public ConfigManager(TaskManager jobManager) {
    5453      this.jobManager = jobManager;
    55       cpuCounter = new PerformanceCounter();
     54      /*cpuCounter = new PerformanceCounter();
    5655      cpuCounter.CategoryName = "Processor";
    5756      cpuCounter.CounterName = "% Processor Time";
    58       cpuCounter.InstanceName = "_Total";
    59       memCounter = new PerformanceCounter("Memory", "Available Bytes", true);
     57      cpuCounter.InstanceName = "_Total";*/
     58      //memCounter = new PerformanceCounter("Memory", "Available Bytes", true);
    6059
    6160      Asleep = false;
     
    136135
    137136    public static Guid GetUniqueMachineId() {
     137      // mock slave id
     138      return Guid.NewGuid();
     139      /*
    138140      Guid id;
     141
    139142      try {
    140143        id = GetUniqueMachineIdFromMac();
     
    145148      }
    146149      return id;
     150      */
    147151    }
    148152
     
    254258
    255259      try {
    256         mb = (int)(memCounter.NextValue() / 1024 / 1024);
     260        //mb = (int)(memCounter.NextValue() / 1024 / 1024);
     261        mb = 1024;
    257262      }
    258263      catch { }
     
    262267    public float GetCpuUtilization() {
    263268      float cpuVal = 0.0F;
    264 
    265       try {
     269      /*try {
    266270        return cpuCounter.NextValue();
    267271      }
    268       catch { }
     272      catch { }    */
    269273      return cpuVal;
    270274    }
Note: See TracChangeset for help on using the changeset viewer.