- Timestamp:
- 06/26/15 11:16:48 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Services.WebApp.Status/3.3/WebApi/DataController.cs
r12514 r12521 73 73 var activeSlaves = onlineSlaves.Where(s => s.IsAllowedToCalculate).ToList(); 74 74 var calculatingSlaves = activeSlaves.Where(s => s.SlaveState == SlaveState.Calculating).ToList(); 75 int calculatingMemory = calculatingSlaves.Any() ? (int)calculatingSlaves.Sum(s => s.Memory) / 1024: 0;76 int freeCalculatingMemory = calculatingSlaves.Any() ? (int)calculatingSlaves.Sum(s => s.FreeMemory) / 1024: 0;75 int calculatingMemory = calculatingSlaves.Any() ? (int)calculatingSlaves.Sum(s => s.Memory) : 0; 76 int freeCalculatingMemory = calculatingSlaves.Any() ? (int)calculatingSlaves.Sum(s => s.FreeMemory) : 0; 77 77 78 78 return new DTO.Status { … … 95 95 }, 96 96 MemoryStatus = new DTO.MemoryStatus { 97 TotalMemory = onlineSlaves.Any() ? (int)onlineSlaves.Sum(s => s.Memory) / 1024: 0,98 FreeMemory = onlineSlaves.Any() ? (int)onlineSlaves.Sum(s => s.FreeMemory) / 1024: 0,99 ActiveMemory = activeSlaves.Any() ? (int)activeSlaves.Sum(s => s.Memory) / 1024: 0,97 TotalMemory = onlineSlaves.Any() ? (int)onlineSlaves.Sum(s => s.Memory) : 0, 98 FreeMemory = onlineSlaves.Any() ? (int)onlineSlaves.Sum(s => s.FreeMemory) : 0, 99 ActiveMemory = activeSlaves.Any() ? (int)activeSlaves.Sum(s => s.Memory) : 0, 100 100 UsedMemory = calculatingMemory - freeCalculatingMemory 101 101 }, … … 109 109 Cores = x.Cores ?? 0, 110 110 FreeCores = x.FreeCores ?? 0, 111 Memory = (x.Memory ?? 0) / 1024,112 FreeMemory = (x.FreeMemory ?? 0) / 1024,111 Memory = x.Memory ?? 0, 112 FreeMemory = x.FreeMemory ?? 0, 113 113 IsAllowedToCalculate = x.IsAllowedToCalculate, 114 114 State = x.SlaveState.ToString() … … 149 149 ? statistic.SlaveStatistics.Average(x => x.CpuUtilization) 150 150 : 0.0; 151 status.MemoryStatus.TotalMemory += statistic.SlaveStatistics.Sum(x => x.Memory) / 1024;152 freeMemory += statistic.SlaveStatistics.Sum(x => x.FreeMemory) / 1024;151 status.MemoryStatus.TotalMemory += statistic.SlaveStatistics.Sum(x => x.Memory); 152 freeMemory += statistic.SlaveStatistics.Sum(x => x.FreeMemory); 153 153 if (i >= increment) { 154 154 status.Timestamp = JavascriptUtils.ToTimestamp(statistic.Timestamp);
Note: See TracChangeset
for help on using the changeset viewer.