Changeset 9661 for branches/HiveStatistics
- Timestamp:
- 06/27/13 15:25:42 (11 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Clients.Access/3.3/app.config
r9461 r9661 29 29 </bindings> 30 30 <client> 31 <endpoint address="http://testhive.fh-hagenberg.at/ Hive-3.3/HiveService.svc" binding="wsHttpBinding"31 <endpoint address="http://testhive.fh-hagenberg.at/AccessService/AccessService.svc" binding="wsHttpBinding" 32 32 bindingConfiguration="WSHttpBinding_IAccessService" contract="HeuristicLab.Clients.Access.IAccessService" 33 33 name="WSHttpBinding_IAccessService"> -
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.Slave/3.3/Manager/ConfigManager.cs
r9373 r9661 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Diagnostics; 24 25 using System.Linq; 25 26 using System.Management; … … 44 45 private TaskManager jobManager; 45 46 private Slave slave; 46 //private PerformanceCounter cpuCounter;47 //private PerformanceCounter memCounter;47 private PerformanceCounter cpuCounter; 48 private PerformanceCounter memCounter; 48 49 49 50 /// <summary> … … 52 53 public ConfigManager(TaskManager jobManager) { 53 54 this.jobManager = jobManager; 54 /*cpuCounter = new PerformanceCounter();55 cpuCounter = new PerformanceCounter(); 55 56 cpuCounter.CategoryName = "Processor"; 56 57 cpuCounter.CounterName = "% Processor Time"; 57 cpuCounter.InstanceName = "_Total"; */58 //memCounter = new PerformanceCounter("Memory", "Available Bytes", true);58 cpuCounter.InstanceName = "_Total"; 59 memCounter = new PerformanceCounter("Memory", "Available Bytes", true); 59 60 60 61 Asleep = false; … … 255 256 /// </summary> 256 257 public int GetFreeMemory() { 257 int mb = 0; 258 259 try { 260 //mb = (int)(memCounter.NextValue() / 1024 / 1024); 261 mb = 1024; 262 } 263 catch { } 264 return mb; 258 try { 259 return (int)(memCounter.NextValue() / 1024 / 1024); 260 } 261 catch { 262 return 0; 263 } 265 264 } 266 265 267 266 public float GetCpuUtilization() { 268 float cpuVal = 0.0F; 269 /*try { 267 try { 270 268 return cpuCounter.NextValue(); 271 269 } 272 catch { } */ 273 return cpuVal; 270 catch { 271 return 0.0f; 272 } 274 273 } 275 274 }
Note: See TracChangeset
for help on using the changeset viewer.