Changeset 12521
- Timestamp:
- 06/26/15 11:16:48 (9 years ago)
- Location:
- trunk/sources/HeuristicLab.Services.WebApp.Status/3.3
- Files:
-
- 4 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); -
trunk/sources/HeuristicLab.Services.WebApp.Status/3.3/WebApp/history/historyCtrl.js
r12519 r12521 39 39 } 40 40 }; 41 41 42 42 43 $scope.fromDate = new Date(); … … 81 82 coreSeries[0].push([curStatus.Timestamp, curStatus.CoreStatus.ActiveCores]); 82 83 coreSeries[1].push([curStatus.Timestamp, curStatus.CoreStatus.CalculatingCores]); 83 memorySeries[0].push([curStatus.Timestamp, curStatus.MemoryStatus.ActiveMemory]);84 memorySeries[1].push([curStatus.Timestamp, curStatus.MemoryStatus.UsedMemory]);84 memorySeries[0].push([curStatus.Timestamp, Math.round(curStatus.MemoryStatus.ActiveMemory / 1024)]); 85 memorySeries[1].push([curStatus.Timestamp, Math.round(curStatus.MemoryStatus.UsedMemory / 1024)]); 85 86 } 86 87 $scope.cpuSeries = [{ data: cpuSeries, label: " CPU Utilization", color: "#f7921d" }]; -
trunk/sources/HeuristicLab.Services.WebApp.Status/3.3/WebApp/status/status.cshtml
r12435 r12521 80 80 <tr data-toggle="tooltip" data-placement="bottom" title="All online slaves"> 81 81 <td class="text-left">Total:</td> 82 <td class="text-right">{{status.MemoryStatus.TotalMemory | number}} GB</td>82 <td class="text-right">{{status.MemoryStatus.TotalMemory | toGB}}</td> 83 83 </tr> 84 84 <tr data-toggle="tooltip" data-placement="bottom" title="All calculating and idle slaves that are allowed to calculate"> 85 85 <td class="text-left">Active:</td> 86 <td class="text-right">{{status.MemoryStatus.ActiveMemory | number}} GB</td>86 <td class="text-right">{{status.MemoryStatus.ActiveMemory | toGB}}</td> 87 87 </tr> 88 88 <tr data-toggle="tooltip" data-placement="bottom" title="All calculating slaves that are allowed to calculate"> 89 89 <td class="text-left">Calculating:</td> 90 <td class="text-right">{{status.MemoryStatus.UsedMemory | number}} GB</td>90 <td class="text-right">{{status.MemoryStatus.UsedMemory | toGB}}</td> 91 91 </tr> 92 92 </table> … … 234 234 <td>{{slave.CpuUtilization | number: 2}} %</td> 235 235 <td>{{slave.Cores | number}}</td> 236 <td>{{slave.Memory | number}} GB</td>236 <td>{{slave.Memory | toGB}}</td> 237 237 </tr> 238 238 <tr ng-hide="activeCalculatingSlaves.length"> … … 292 292 <td>{{slave.CpuUtilization | number: 2}} %</td> 293 293 <td>{{slave.Cores | number}}</td> 294 <td>{{slave.Memory | number}} GB</td>294 <td>{{slave.Memory | toGB}}</td> 295 295 </tr> 296 296 <tr ng-hide="activeIdleSlaves.length"> … … 349 349 <td>{{slave.CpuUtilization | number: 2}} %</td> 350 350 <td>{{slave.Cores | number}}</td> 351 <td>{{slave.Memory | number}} GB</td>351 <td>{{slave.Memory | toGB}}</td> 352 352 </tr> 353 353 <tr ng-hide="inactiveSlaves.length"> -
trunk/sources/HeuristicLab.Services.WebApp.Status/3.3/WebApp/status/statusCtrl.js
r12445 r12521 148 148 coreSeries[0].push([$scope.status.Timestamp, status.CoreStatus.TotalCores]); 149 149 coreSeries[1].push([$scope.status.Timestamp, usedCores]); 150 memorySeries[0].push([$scope.status.Timestamp, status.MemoryStatus.TotalMemory]);151 memorySeries[1].push([$scope.status.Timestamp, usedMemory]);150 memorySeries[0].push([$scope.status.Timestamp, Math.round(status.MemoryStatus.TotalMemory / 1024)]); 151 memorySeries[1].push([$scope.status.Timestamp, Math.round(usedMemory / 1024)]); 152 152 $scope.cpu.series = [{ data: cpuSeries, label: " CPU Utilization", color: "#f7921d" }]; 153 153 $scope.core.series = [ … … 170 170 var noOfStatus = status.length; 171 171 var cpuSeries = []; 172 var coreSeries = [[], []];173 var memorySeries = [[], []];172 var coreSeries = [[], []]; 173 var memorySeries = [[], []]; 174 174 for (var i = 0; i < noOfStatus; ++i) { 175 175 var curStatus = status[i]; … … 178 178 coreSeries[0].push([curStatus.Timestamp, curStatus.CoreStatus.ActiveCores]); 179 179 coreSeries[1].push([curStatus.Timestamp, curStatus.CoreStatus.CalculatingCores]); 180 memorySeries[0].push([curStatus.Timestamp, curStatus.MemoryStatus.ActiveMemory]);181 memorySeries[1].push([curStatus.Timestamp, curStatus.MemoryStatus.UsedMemory]);180 memorySeries[0].push([curStatus.Timestamp, Math.round(curStatus.MemoryStatus.ActiveMemory / 1024)]); 181 memorySeries[1].push([curStatus.Timestamp, Math.round(curStatus.MemoryStatus.UsedMemory / 1024)]); 182 182 } 183 183 $scope.cpu.series = [{ data: cpuSeries, label: " CPU Utilization", color: "#f7921d" }]; … … 202 202 }] 203 203 ); 204 205 module.filter('toGB', function () { 206 return function (text, length, end) { 207 if (text == null || text == '') text = '0'; 208 text = Math.round(parseInt(text) / 1024); 209 return text + ' GB'; 210 }; 211 }); 212 204 213 })();
Note: See TracChangeset
for help on using the changeset viewer.