Changeset 12858 for branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Maintenance/3.3/WebApi/FactClientInfoController.cs
- Timestamp:
- 08/13/15 15:22:51 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Maintenance/3.3/WebApi/FactClientInfoController.cs
r12777 r12858 36 36 37 37 public DT.FactClientInfo GetFactClientInfo(DateTime start, DateTime end) { 38 using (var pm = PersistenceManager) { 39 var factClientInfo = pm.FactClientInfoDao; 40 var query = factClientInfo.GetAll().Where(x => x.Time >= start && x.Time <= end); 41 return new DT.FactClientInfo { 42 Rows = query.Count(), 43 Clients = query.Select(x => x.ClientId).Distinct().Count() 44 }; 45 } 38 var pm = PersistenceManager; 39 var factClientInfo = pm.FactClientInfoDao; 40 var query = factClientInfo.GetAll().Where(x => x.Time >= start && x.Time <= end); 41 return new DT.FactClientInfo { 42 Rows = query.Count(), 43 Clients = query.Select(x => x.ClientId).Distinct().Count() 44 }; 46 45 } 47 46 48 47 public void Aggregate(DateTime start, DateTime end, int entries) { 49 using (var pm = PersistenceManager) { 50 var factClientInfoDao = pm.FactClientInfoDao; 51 var dimTimeDao = pm.DimTimeDao; 52 var clientIds = pm.UseTransaction(() => factClientInfoDao.GetAll() 53 .Where(x => x.Time >= start && x.Time <= end) 54 .Select(x => x.ClientId) 55 .Distinct() 56 ); 57 foreach (var id in clientIds) { 58 AggregateClient(pm, id, start, end, entries); 59 } 60 dimTimeDao.DeleteUnusedTimes(); 48 var pm = PersistenceManager; 49 var factClientInfoDao = pm.FactClientInfoDao; 50 var dimTimeDao = pm.DimTimeDao; 51 var clientIds = pm.UseTransaction(() => factClientInfoDao.GetAll() 52 .Where(x => x.Time >= start && x.Time <= end) 53 .Select(x => x.ClientId) 54 .Distinct() 55 ); 56 foreach (var id in clientIds) { 57 AggregateClient(pm, id, start, end, entries); 61 58 } 59 dimTimeDao.DeleteUnusedTimes(); 62 60 } 63 61
Note: See TracChangeset
for help on using the changeset viewer.