- Timestamp:
- 06/18/15 11:56:31 (9 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources
- Property svn:mergeinfo changed
/trunk/sources (added) merged: 12442-12443,12445,12455-12458,12461,12463-12465 -
Property
svn:global-ignores
set to
*.nuget
packages
- Property svn:mergeinfo changed
-
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Status/3.3/WebApi/DataController.cs
r12435 r12467 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Data.Linq; 24 25 using System.Linq; 25 26 using System.Web.Http; … … 42 43 SELECT 43 44 DISTINCT UserId, 44 (SELECT Count FROM UserTasks WHERE TaskState = 'Calculating' AND UserId = ut.UserId) AS CalculatingTasks,45 (SELECT Count FROM UserTasks WHERE TaskState = 'Waiting' AND UserId = ut.UserId) AS WaitingTasks45 ISNULL((SELECT Count FROM UserTasks WHERE TaskState = 'Calculating' AND UserId = ut.UserId), 0) AS CalculatingTasks, 46 ISNULL((SELECT Count FROM UserTasks WHERE TaskState = 'Waiting' AND UserId = ut.UserId), 0) AS WaitingTasks 46 47 FROM UserTasks ut;"; 47 48 48 49 49 private class UserTaskStatus { … … 73 73 var activeSlaves = onlineSlaves.Where(s => s.IsAllowedToCalculate).ToList(); 74 74 var calculatingSlaves = activeSlaves.Where(s => s.SlaveState == SlaveState.Calculating).ToList(); 75 76 75 int calculatingMemory = calculatingSlaves.Any() ? (int)calculatingSlaves.Sum(s => s.Memory) / 1024 : 0; 77 76 int freeCalculatingMemory = calculatingSlaves.Any() ? (int)calculatingSlaves.Sum(s => s.FreeMemory) / 1024 : 0; … … 129 128 } 130 129 using (var db = new HiveDataContext()) { 131 var statistics = db.Statistics.Where(s => s.Timestamp >= start && s.Timestamp <= end); 130 DataLoadOptions loadOptions = new DataLoadOptions(); 131 loadOptions.LoadWith<Statistics>(o => o.SlaveStatistics); 132 db.LoadOptions = loadOptions; 133 db.DeferredLoadingEnabled = false; 134 var statistics = db.Statistics.Where(s => s.Timestamp >= start && s.Timestamp <= end) 135 .OrderBy(s => s.Timestamp) 136 .ToList(); 132 137 var status = new DTO.Status { 133 138 CoreStatus = new DTO.CoreStatus(),
Note: See TracChangeset
for help on using the changeset viewer.