Changeset 16723 for branches/2521_ProblemRefactoring/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/ClientController.cs
- Timestamp:
- 03/28/19 16:54:20 (6 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Services.WebApp.Statistics
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/branches/2520_PersistenceReintegration/HeuristicLab.Services.WebApp.Statistics merged eligible /branches/2947_ConfigurableIndexedDataTable/HeuristicLab.Services.WebApp.Statistics merged eligible /branches/2965_CancelablePersistence/HeuristicLab.Services.WebApp.Statistics merged eligible /stable/HeuristicLab.Services.WebApp.Statistics merged eligible /trunk/HeuristicLab.Services.WebApp.Statistics merged eligible /branches/1721-RandomForestPersistence/HeuristicLab.Services.WebApp.Statistics 10321-10322 /branches/2892_LR-prediction-intervals/HeuristicLab.Services.WebApp.Statistics 15743-16388 /branches/2915-AbsoluteSymbol/HeuristicLab.Services.WebApp.Statistics 15943-16355 /branches/Algorithms.GradientDescent/HeuristicLab.Services.WebApp.Statistics 5516-5520 /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
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/2521_ProblemRefactoring/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/ClientController.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 74 74 on client.Id equals info.ClientId into clientInfoJoin 75 75 from clientInfo in clientInfoJoin.OrderByDescending(x => x.Time).Take(1) 76 let offline = (client.ExpirationTime != null || clientInfo.SlaveState == SlaveState.Offline) 76 let offline = (client.DateExpired != null || clientInfo.SlaveState == SlaveState.Offline) 77 let parent = client.ParentResourceId.HasValue ? dimClientDao.GetById(client.ParentResourceId.Value) : null 77 78 select new DT.ClientDetails { 78 79 Id = client.Id, … … 85 86 State = offline ? SlaveState.Offline.ToString() : clientInfo.SlaveState.ToString(), 86 87 LastUpdate = clientInfo.Time, 87 GroupId = client. ResourceGroupId,88 GroupName = client.GroupName,88 GroupId = client.ParentResourceId, 89 GroupName = parent != null ? parent.Name : null, 89 90 UpTime = offline ? 0 : upTime, 90 91 TotalUnavailableTime = timeData != null ? timeData.TotalUnavailableTime : 0, … … 117 118 var factClientInfoDao = pm.FactClientInfoDao; 118 119 return pm.UseTransaction(() => { 119 var clients = expired ? dimClientDao.Get ExpiredClients() : dimClientDao.GetActiveClients();120 var clients = expired ? dimClientDao.GetAllExpiredSlaves() : dimClientDao.GetAllOnlineSlaves(); 120 121 var query = (from client in clients 121 122 join info in factClientInfoDao.GetAll() … … 123 124 from clientInfo in clientInfoJoin.OrderByDescending(x => x.Time).Take(1) 124 125 let offline = (expired || clientInfo.SlaveState == SlaveState.Offline) 126 let parent = client.ParentResourceId.HasValue ? dimClientDao.GetById(client.ParentResourceId.Value) : null 125 127 select new DT.Client { 126 128 Id = client.Id, … … 132 134 CpuUtilization = offline ? 0 : clientInfo.CpuUtilization, 133 135 State = offline ? SlaveState.Offline.ToString() : clientInfo.SlaveState.ToString(), 134 GroupId = client. ResourceGroupId,135 GroupName = client.GroupName,136 GroupId = client.ParentResourceId, 137 GroupName = parent != null ? parent.Name : null, 136 138 IsAllowedToCalculate = clientInfo.IsAllowedToCalculate 137 139 }); … … 200 202 var factClientInfoDao = pm.FactClientInfoDao; 201 203 return pm.UseTransaction(() => { 202 var clients = expired ? dimClientDao.Get ExpiredClients() : dimClientDao.GetActiveClients();203 clients = clients.Where(x => x. ResourceGroupId == id);204 var clients = expired ? dimClientDao.GetAllExpiredClients() : dimClientDao.GetAllOnlineClients(); 205 clients = clients.Where(x => x.ParentResourceId == id); 204 206 var query = (from client in clients 205 207 join info in factClientInfoDao.GetAll() … … 207 209 from clientInfo in clientInfoJoin.OrderByDescending(x => x.Time).Take(1) 208 210 let offline = (expired || clientInfo.SlaveState == SlaveState.Offline) 211 let parent = client.ParentResourceId.HasValue ? dimClientDao.GetById(client.ParentResourceId.Value) : null 209 212 select new DT.Client { 210 213 Id = client.Id, … … 216 219 CpuUtilization = offline ? 0 : clientInfo.CpuUtilization, 217 220 State = offline ? SlaveState.Offline.ToString() : clientInfo.SlaveState.ToString(), 218 GroupId = client. ResourceGroupId,219 GroupName = client.GroupName,221 GroupId = client.ParentResourceId, 222 GroupName = parent != null ? parent.Name : null, 220 223 IsAllowedToCalculate = clientInfo.IsAllowedToCalculate 221 224 }); … … 247 250 client => client.Id, 248 251 (fact, client) => new { 249 client. ResourceGroupId,252 client.ParentResourceId, 250 253 fact.Time, 251 254 fact.CpuUtilization, … … 255 258 fact.UsedMemory 256 259 }) 257 .Where(x => x. ResourceGroupId == id)260 .Where(x => x.ParentResourceId == id) 258 261 .ToList(); 259 262 var clientStatus = new DT.ClientStatus {
Note: See TracChangeset
for help on using the changeset viewer.