Changeset 16141 for branches/2817-BinPackingSpeedup/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/GroupController.cs
- Timestamp:
- 09/14/18 11:47:37 (6 years ago)
- Location:
- branches/2817-BinPackingSpeedup
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2817-BinPackingSpeedup
- Property svn:mergeinfo changed
-
branches/2817-BinPackingSpeedup/HeuristicLab.Services.WebApp.Statistics
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/stable/HeuristicLab.Services.WebApp.Statistics merged eligible /trunk/HeuristicLab.Services.WebApp.Statistics merged eligible /branches/1721-RandomForestPersistence/HeuristicLab.Services.WebApp.Statistics 10321-10322 /branches/Algorithms.GradientDescent/HeuristicLab.Services.WebApp.Statistics 5516-5520 /branches/Async/HeuristicLab.Services.WebApp.Statistics 13329-15286 /branches/Benchmarking/sources/HeuristicLab.Services.WebApp.Statistics 6917-7005 /branches/CloningRefactoring/HeuristicLab.Services.WebApp.Statistics 4656-4721 /branches/CodeEditor/HeuristicLab.Services.WebApp.Statistics 11700-11806 /branches/DataAnalysis Refactoring/HeuristicLab.Services.WebApp.Statistics 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Services.WebApp.Statistics 5815-6180 /branches/DataAnalysis/HeuristicLab.Services.WebApp.Statistics 4458-4459,4462,4464 /branches/DataPreprocessing/HeuristicLab.Services.WebApp.Statistics 10085-11101 /branches/GP.Grammar.Editor/HeuristicLab.Services.WebApp.Statistics 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Services.WebApp.Statistics 5060 /branches/HLScript/HeuristicLab.Services.WebApp.Statistics 10331-10358 /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Services.WebApp.Statistics 11570-12508 /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Services.WebApp.Statistics 6123-9799 /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Services.WebApp.Statistics 11130-12721 /branches/HiveProjectManagement/HeuristicLab.Services.WebApp.Statistics 15377-15760 /branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics 12440-12877 /branches/LogResidualEvaluator/HeuristicLab.Services.WebApp.Statistics 10202-10483 /branches/NET40/sources/HeuristicLab.Services.WebApp.Statistics 5138-5162 /branches/NSGA-II Changes/HeuristicLab.Services.WebApp.Statistics 12033-12122 /branches/ParallelEngine/HeuristicLab.Services.WebApp.Statistics 5175-5192 /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Services.WebApp.Statistics 7568-7810 /branches/QAPAlgorithms/HeuristicLab.Services.WebApp.Statistics 6350-6627 /branches/Restructure trunk solution/HeuristicLab.Services.WebApp.Statistics 6828 /branches/RuntimeOptimizer/HeuristicLab.Services.WebApp.Statistics 8943-9078 /branches/ScatterSearch (trunk integration)/HeuristicLab.Services.WebApp.Statistics 7787-8333 /branches/SlaveShutdown/HeuristicLab.Services.WebApp.Statistics 8944-8956 /branches/SpectralKernelForGaussianProcesses/HeuristicLab.Services.WebApp.Statistics 10204-10479 /branches/SuccessProgressAnalysis/HeuristicLab.Services.WebApp.Statistics 5370-5682 /branches/Trunk/HeuristicLab.Services.WebApp.Statistics 6829-6865 /branches/UnloadJobs/HeuristicLab.Services.WebApp.Statistics 9168-9215 /branches/VNS/HeuristicLab.Services.WebApp.Statistics 5594-5752 /branches/crossvalidation-2434/HeuristicLab.Services.WebApp.Statistics 12948-12950 /branches/histogram/HeuristicLab.Services.WebApp.Statistics 5959-6341 /branches/symbreg-factors-2650/HeuristicLab.Services.WebApp.Statistics 14232-14825
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/2817-BinPackingSpeedup/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/GroupController.cs
r16140 r16141 42 42 var clientTimeData = factClientInfoDao.GetAll() 43 43 .Join(dimClientDao.GetAll(), x => x.ClientId, y => y.Id, (x, y) => new { 44 y. ResourceGroupId,44 y.ParentResourceId, 45 45 x.IdleTime, 46 46 x.OfflineTime, 47 47 x.UnavailableTime 48 48 }) 49 .Where(x => x. ResourceGroupId == id)50 .GroupBy(x => x. ResourceGroupId)49 .Where(x => x.ParentResourceId == id) 50 .GroupBy(x => x.ParentResourceId) 51 51 .Select(x => new { 52 52 TotalIdleTime = x.Sum(y => y.IdleTime), … … 68 68 }) 69 69 .FirstOrDefault(); 70 return (from client in dimClientDao.GetA ctiveClients().Where(x => x.ResourceGroupId == id)70 return (from client in dimClientDao.GetAllOnlineSlaves().Where(x => x.ParentResourceId == id) 71 71 join info in factClientInfoDao.GetAll() 72 72 on client.Id equals info.ClientId into clientInfoJoin 73 73 from clientInfo in clientInfoJoin.OrderByDescending(x => x.Time).Take(1) 74 74 let offline = (clientInfo.SlaveState == DA.SlaveState.Offline) 75 let parent = client.ParentResourceId.HasValue ? dimClientDao.GetById(client.ParentResourceId.Value) : null 75 76 select new { 76 ResourceGroupId = client. ResourceGroupId,77 GroupName = client.GroupName,77 ResourceGroupId = client.ParentResourceId, 78 GroupName = parent != null ? parent.Name : null, 78 79 TotalCores = clientInfo.NumTotalCores, 79 80 UsedCores = offline ? 0 : clientInfo.NumUsedCores, … … 114 115 var dimClientDao = pm.DimClientDao; 115 116 var factClientInfoDao = pm.FactClientInfoDao; 116 var data = (from client in dimClientDao.GetA ctiveClients()117 var data = (from client in dimClientDao.GetAllOnlineSlaves() 117 118 join info in factClientInfoDao.GetAll() 118 119 on client.Id equals info.ClientId into clientInfoJoin … … 120 121 let offline = (clientInfo.SlaveState == DA.SlaveState.Offline) 121 122 select new { 122 ResourceGroupId = client. ResourceGroupId,123 ResourceGroupId = client.ParentResourceId, 123 124 TotalCores = clientInfo.NumTotalCores, 124 125 UsedCores = offline ? 0 : clientInfo.NumUsedCores, … … 137 138 CpuUtilization = x.Where(y => y.SlaveState != DA.SlaveState.Offline).Average(y => (double?)y.CpuUtilization) ?? 0.0 138 139 }); 139 var query = dimClientDao.GetAll() 140 .GroupBy(x => new { x.ResourceGroupId, x.GroupName }) 141 .Select(x => new { 142 Id = x.Key.ResourceGroupId ?? default(Guid), 143 Name = x.Key.GroupName 144 }); 140 141 var query = dimClientDao.GetAllOnlineSlaveGroups().Select(x => new { 142 Id = x.ResourceId, 143 Name = x.Name 144 }); 145 145 return pm.UseTransaction(() => new DT.GroupPage { 146 146 TotalGroups = query.Count(),
Note: See TracChangeset
for help on using the changeset viewer.