Changeset 9373 for branches/HivePerformance/sources/HeuristicLab.Clients.Hive.Slave/3.3/Manager/ConfigManager.cs
- Timestamp:
- 04/17/13 15:43:37 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HivePerformance/sources/HeuristicLab.Clients.Hive.Slave/3.3/Manager/ConfigManager.cs
r7857 r9373 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Diagnostics;25 24 using System.Linq; 26 25 using System.Management; … … 45 44 private TaskManager jobManager; 46 45 private Slave slave; 47 private PerformanceCounter cpuCounter;48 private PerformanceCounter memCounter;46 //private PerformanceCounter cpuCounter; 47 //private PerformanceCounter memCounter; 49 48 50 49 /// <summary> … … 53 52 public ConfigManager(TaskManager jobManager) { 54 53 this.jobManager = jobManager; 55 cpuCounter = new PerformanceCounter();54 /*cpuCounter = new PerformanceCounter(); 56 55 cpuCounter.CategoryName = "Processor"; 57 56 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); 60 59 61 60 Asleep = false; … … 136 135 137 136 public static Guid GetUniqueMachineId() { 137 // mock slave id 138 return Guid.NewGuid(); 139 /* 138 140 Guid id; 141 139 142 try { 140 143 id = GetUniqueMachineIdFromMac(); … … 145 148 } 146 149 return id; 150 */ 147 151 } 148 152 … … 254 258 255 259 try { 256 mb = (int)(memCounter.NextValue() / 1024 / 1024); 260 //mb = (int)(memCounter.NextValue() / 1024 / 1024); 261 mb = 1024; 257 262 } 258 263 catch { } … … 262 267 public float GetCpuUtilization() { 263 268 float cpuVal = 0.0F; 264 265 try { 269 /*try { 266 270 return cpuCounter.NextValue(); 267 271 } 268 catch { } 272 catch { } */ 269 273 return cpuVal; 270 274 }
Note: See TracChangeset
for help on using the changeset viewer.