Changeset 12776
- Timestamp:
- 07/17/15 16:57:22 (9 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab 3.3 Services.sln
r12761 r12776 260 260 {3F22B7DA-FDDB-48F0-8BB7-0ABA5120FC87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 261 261 {3F22B7DA-FDDB-48F0-8BB7-0ABA5120FC87}.Debug|Any CPU.Build.0 = Debug|Any CPU 262 {3F22B7DA-FDDB-48F0-8BB7-0ABA5120FC87}.Debug|x64.ActiveCfg = Debug|Any CPU 263 {3F22B7DA-FDDB-48F0-8BB7-0ABA5120FC87}.Debug|x86.ActiveCfg = Debug|Any CPU 262 {3F22B7DA-FDDB-48F0-8BB7-0ABA5120FC87}.Debug|x64.ActiveCfg = Debug|x64 263 {3F22B7DA-FDDB-48F0-8BB7-0ABA5120FC87}.Debug|x64.Build.0 = Debug|x64 264 {3F22B7DA-FDDB-48F0-8BB7-0ABA5120FC87}.Debug|x86.ActiveCfg = Debug|x86 265 {3F22B7DA-FDDB-48F0-8BB7-0ABA5120FC87}.Debug|x86.Build.0 = Debug|x86 264 266 {3F22B7DA-FDDB-48F0-8BB7-0ABA5120FC87}.Release|Any CPU.ActiveCfg = Release|Any CPU 265 267 {3F22B7DA-FDDB-48F0-8BB7-0ABA5120FC87}.Release|Any CPU.Build.0 = Release|Any CPU -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs
r12765 r12776 134 134 135 135 private void UpdateExistingDimJobs(PersistenceManager pm) { 136 var jobDao = pm.JobDao; 136 137 var dimJobDao = pm.DimJobDao; 137 138 var factTaskDao = pm.FactTaskDao; … … 151 152 } 152 153 if (totalTasks == completedTasks) { 153 dimJob.DateCompleted = factTaskDao.GetLastCompletedTaskFromJob(dimJob.JobId) ?? DateTime.Now; 154 var completeDate = factTaskDao.GetLastCompletedTaskFromJob(dimJob.JobId); 155 if (completeDate == null) { 156 if (jobDao.GetById(dimJob.JobId) == null) { 157 completeDate = DateTime.Now; 158 } 159 } 160 dimJob.DateCompleted = completeDate; 154 161 } 155 162 dimJob.TotalTasks = totalTasks; -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/NewHiveService.cs
r12768 r12776 128 128 } 129 129 130 public IEnumerable< Task> GetTasks() {130 public IEnumerable<DT.Task> GetTasks() { 131 131 // unused 132 132 throw new NotImplementedException(); 133 133 } 134 134 135 public IEnumerable< LightweightTask> GetLightweightTasks(IEnumerable<Guid> taskIds) {135 public IEnumerable<DT.LightweightTask> GetLightweightTasks(IEnumerable<Guid> taskIds) { 136 136 // unused 137 137 throw new NotImplementedException(); 138 138 } 139 139 140 public IEnumerable< LightweightTask> GetLightweightChildTasks(Guid? parentTaskId, bool recursive, bool includeParent) {140 public IEnumerable<DT.LightweightTask> GetLightweightChildTasks(Guid? parentTaskId, bool recursive, bool includeParent) { 141 141 // unused 142 142 throw new NotImplementedException(); … … 398 398 } 399 399 400 public IEnumerable< Job> GetAllJobs() {400 public IEnumerable<DT.Job> GetAllJobs() { 401 401 // unused 402 402 throw new NotImplementedException(); 403 403 } 404 404 405 public Guid AddJob( Job jobDto) {405 public Guid AddJob(DT.Job jobDto) { 406 406 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 407 407 using (var pm = PersistenceManager) 408 408 using (new PerformanceLogger("AddJob")) { 409 409 var jobDao = pm.JobDao; 410 var userPriorityDao = pm.UserPriorityDao; 410 411 return pm.UseTransaction(() => { 411 412 jobDto.OwnerUserId = UserManager.CurrentUserId; 412 413 jobDto.DateCreated = DateTime.Now; 413 414 var job = jobDao.Save(jobDto.ToEntity()); 415 if (userPriorityDao.GetById(jobDto.OwnerUserId) == null) { 416 userPriorityDao.Save(new DA.UserPriority { 417 UserId = jobDto.OwnerUserId, 418 DateEnqueued = jobDto.DateCreated 419 }); 420 } 414 421 pm.SubmitChanges(); 415 422 return job.JobId; … … 447 454 var jobDao = pm.JobDao; 448 455 pm.UseTransaction(() => { 456 // child task will be deleted by db-trigger 449 457 jobDao.Delete(jobId); 450 458 pm.SubmitChanges(); … … 546 554 547 555 #region Heartbeat Methods 548 public List<MessageContainer> Heartbeat( Heartbeat heartbeat) {556 public List<MessageContainer> Heartbeat(DT.Heartbeat heartbeat) { 549 557 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Slave); 550 558 List<MessageContainer> result = new List<MessageContainer>(); … … 565 573 566 574 #region Plugin Methods 567 public Plugin GetPlugin(Guid pluginId) {575 public DT.Plugin GetPlugin(Guid pluginId) { 568 576 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave); 569 577 using (var pm = PersistenceManager) … … 574 582 } 575 583 576 public Plugin GetPluginByHash(byte[] hash) {584 public DT.Plugin GetPluginByHash(byte[] hash) { 577 585 // unused 578 586 throw new NotImplementedException(); 579 587 } 580 588 581 public Guid AddPlugin( Plugin plugin, List<PluginData> pluginData) {589 public Guid AddPlugin(DT.Plugin plugin, List<DT.PluginData> pluginData) { 582 590 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 583 591 using (var pm = PersistenceManager) … … 593 601 pluginEntity = plugin.ToEntity(); 594 602 foreach (var data in pluginData) { 595 data.PluginId = default(Guid); 603 data.PluginId = default(Guid); // real id will be assigned from linq2sql 596 604 pluginEntity.PluginData.Add(data.ToEntity()); 597 605 } … … 603 611 } 604 612 605 public IEnumerable< Plugin> GetPlugins() {613 public IEnumerable<DT.Plugin> GetPlugins() { 606 614 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave); 607 615 using (var pm = PersistenceManager) … … 616 624 } 617 625 618 public IEnumerable< PluginData> GetPluginDatas(List<Guid> pluginIds) {626 public IEnumerable<DT.PluginData> GetPluginDatas(List<Guid> pluginIds) { 619 627 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave); 620 628 using (var pm = PersistenceManager) … … 668 676 } 669 677 670 public IEnumerable< ResourcePermission> GetResourcePermissions(Guid resourceId) {678 public IEnumerable<DT.ResourcePermission> GetResourcePermissions(Guid resourceId) { 671 679 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 672 680 using (var pm = PersistenceManager) … … 682 690 683 691 #region Resource Methods 684 public IEnumerable< Resource> GetChildResources(Guid resourceId) {692 public IEnumerable<DT.Resource> GetChildResources(Guid resourceId) { 685 693 // unused 686 694 throw new NotImplementedException(); … … 718 726 } 719 727 720 public Slave GetSlave(Guid slaveId) {728 public DT.Slave GetSlave(Guid slaveId) { 721 729 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator); 722 730 using (var pm = PersistenceManager) … … 727 735 } 728 736 729 public SlaveGroup GetSlaveGroup(Guid slaveGroupId) {737 public DT.SlaveGroup GetSlaveGroup(Guid slaveGroupId) { 730 738 // unused 731 739 throw new NotImplementedException(); 732 740 } 733 741 734 public IEnumerable< Slave> GetSlaves() {742 public IEnumerable<DT.Slave> GetSlaves() { 735 743 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 736 744 bool isAdministrator = RoleVerifier.IsInRole(HiveRoles.Administrator); … … 757 765 } 758 766 759 public IEnumerable< SlaveGroup> GetSlaveGroups() {767 public IEnumerable<DT.SlaveGroup> GetSlaveGroups() { 760 768 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 761 769 bool isAdministrator = RoleVerifier.IsInRole(HiveRoles.Administrator); … … 878 886 } 879 887 880 public IEnumerable< Task> GetTasksByResourceId(Guid resourceId) {888 public IEnumerable<DT.Task> GetTasksByResourceId(Guid resourceId) { 881 889 // unused 882 890 throw new NotImplementedException(); … … 967 975 } 968 976 969 public IEnumerable<D owntime> GetDowntimesForResource(Guid resourceId) {977 public IEnumerable<DT.Downtime> GetDowntimesForResource(Guid resourceId) { 970 978 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 971 979 using (var pm = PersistenceManager) … … 995 1003 996 1004 #region UserPriorities Methods 997 public IEnumerable< UserPriority> GetUserPriorities() {1005 public IEnumerable<DT.UserPriority> GetUserPriorities() { 998 1006 using (var pm = PersistenceManager) 999 1007 using (new PerformanceLogger("GetUserPriorities")) { -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/Properties/AssemblyInfo.cs.frame
r12477 r12776 27 27 // set of attributes. Change these attribute values to modify the information 28 28 // associated with an assembly. 29 [assembly: AssemblyTitle("HeuristicLab.Services.WebApp ")]30 [assembly: AssemblyDescription("HeuristicLab Services Application Container")]29 [assembly: AssemblyTitle("HeuristicLab.Services.WebApp.Statistics")] 30 [assembly: AssemblyDescription("HeuristicLab WebApp Statistics plugin")] 31 31 [assembly: AssemblyConfiguration("")] 32 32 [assembly: AssemblyCompany("")] -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/ClientController.cs
r12584 r12776 83 83 UsedMemory = offline ? 0 : clientInfo.UsedMemory, 84 84 CpuUtilization = offline ? 0 : clientInfo.CpuUtilization, 85 State = clientInfo.SlaveState.ToString(),85 State = offline ? SlaveState.Offline.ToString() : clientInfo.SlaveState.ToString(), 86 86 LastUpdate = clientInfo.Time, 87 87 GroupId = client.ResourceGroupId, … … 132 132 UsedMemory = offline ? 0 : clientInfo.UsedMemory, 133 133 CpuUtilization = offline ? 0 : clientInfo.CpuUtilization, 134 State = clientInfo.SlaveState.ToString(),134 State = offline ? SlaveState.Offline.ToString() : clientInfo.SlaveState.ToString(), 135 135 GroupId = client.ResourceGroupId, 136 136 GroupName = client.GroupName, … … 218 218 UsedMemory = offline ? 0 : clientInfo.UsedMemory, 219 219 CpuUtilization = offline ? 0 : clientInfo.CpuUtilization, 220 State = clientInfo.SlaveState.ToString(),220 State = offline ? SlaveState.Offline.ToString() : clientInfo.SlaveState.ToString(), 221 221 GroupId = client.ResourceGroupId, 222 222 GroupName = client.GroupName, -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/clients/details/clientTaskDetailsDialog.cshtml
r12768 r12776 5 5 <h4 class="modal-title">Task #{{taskNo}} - {{task.Id}}</h4> 6 6 </div> 7 <div class="modal-body" style="height: 4 30px">7 <div class="modal-body" style="height: 440px"> 8 8 <tabset> 9 9 <tab heading="Details"> 10 <div style="height: 3 30px" class="center-block">10 <div style="height: 340px" class="center-block"> 11 11 <div class="row" style="padding-top: 30px"> 12 12 <div class="col-md-6"> -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/jobs/details/jobTaskDetailsDialog.cshtml
r12768 r12776 3 3 <h4 class="modal-title">Task #{{taskNo}} - {{task.Id}}</h4> 4 4 </div> 5 <div class="modal-body" style="height: 4 30px">5 <div class="modal-body" style="height: 440px"> 6 6 <tabset> 7 7 <tab heading="Details"> 8 <div style="height: 3 30px" class="center-block">8 <div style="height: 340px" class="center-block"> 9 9 <div class="row" style="padding-top: 30px"> 10 10 <div class="col-md-12"> -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3/Configs/BundleConfig.cs
r12584 r12776 106 106 PluginManager pluginManager = PluginManager.Instance; 107 107 foreach (var plugin in pluginManager.Plugins) { 108 if (File.Exists(string.Format(@"{0}\{1}\{1}.js", PluginManager.PluginsDirectory, plugin.Name))) { 108 var path = Path.Combine(PluginManager.PluginsDirectory, plugin.Name, string.Concat(plugin.Name, ".js")); 109 if (File.Exists(path)) { 109 110 jsFiles.Add(string.Format("WebApp/plugins/{0}/{0}.js", plugin.Name)); 110 111 } -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3/PluginManager.cs
r12765 r12776 43 43 44 44 public static string PluginsDirectory { 45 get { return string.Format(@"{0}WebApp\plugins", HttpRuntime.AppDomainAppPath); } 45 get { 46 return Path.Combine(HttpRuntime.AppDomainAppPath, "WebApp", "plugins"); 47 } 46 48 } 47 49 … … 94 96 Plugin plugin = LookupPlugin(name); 95 97 if (plugin == null) { 96 string directory = string.Format(@"{0}\{1}",PluginsDirectory, name);98 string directory = Path.Combine(PluginsDirectory, name); 97 99 if (Directory.Exists(directory)) { 98 100 plugin = new Plugin(name, directory, Configuration);
Note: See TracChangeset
for help on using the changeset viewer.