- Timestamp:
- 05/20/15 16:41:14 (10 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources
- Property svn:mergeinfo changed
-
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Web
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Services.Hive.Web merged: 11623,12012,12146
- Property svn:mergeinfo changed
-
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Web/Hive-3.3/App_Data/PublishProfiles/Hive-3.3.pubxml
r9589 r12395 22 22 <Objects xmlns=""> 23 23 <ObjectGroup Name="HeuristicLab.Services.Hive.DataAccess.Settings.HeuristicLab_Hive_LinqConnectionString" Order="1" Enabled="False"> 24 <Destination Path="Data Source= localhost;Initial Catalog=HeuristicLab.Hive-3.3;Integrated Security=True" />24 <Destination Path="Data Source=.\SQLEXPRESS;Initial Catalog=HeuristicLab.Hive-3.3;Integrated Security=True" /> 25 25 <Object Type="DbDacFx"> 26 <PreSource Path="Data Source= localhost;Initial Catalog=HeuristicLab.Hive-3.3;Integrated Security=True" includeData="False" />26 <PreSource Path="Data Source=.\SQLEXPRESS;Initial Catalog=HeuristicLab.Hive-3.3;Integrated Security=True" includeData="False" /> 27 27 <Source Path="$(IntermediateOutputPath)AutoScripts\HeuristicLab.Services.Hive.DataAccess.Settings.HeuristicLab_Hive_LinqConnectionString_IncrementalSchemaOnly.dacpac" dacpacAction="Deploy" /> 28 28 </Object> 29 29 <UpdateFrom Type="Web.Config"> 30 <Source MatchValue="Data Source= localhost;Initial Catalog=HeuristicLab.Hive-3.3;Integrated Security=True;" MatchAttributes="$(UpdateFromConnectionStringAttributes)" />30 <Source MatchValue="Data Source=.\SQLEXPRESS;Initial Catalog=HeuristicLab.Hive-3.3;Integrated Security=True;" MatchAttributes="$(UpdateFromConnectionStringAttributes)" /> 31 31 </UpdateFrom> 32 32 </ObjectGroup> … … 34 34 <Destination Path="" /> 35 35 <Object Type="DbDacFx"> 36 <PreSource Path="data source= localhost;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Authentication" includeData="False" />36 <PreSource Path="data source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Authentication" includeData="False" /> 37 37 <Source Path="$(IntermediateOutputPath)AutoScripts\HeuristicLab.Authentication_IncrementalSchemaOnly.dacpac" dacpacAction="Deploy" /> 38 38 </Object> 39 39 <UpdateFrom Type="Web.Config"> 40 <Source MatchValue="data source= localhost;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Authentication" MatchAttributes="$(UpdateFromConnectionStringAttributes)" />40 <Source MatchValue="data source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Authentication" MatchAttributes="$(UpdateFromConnectionStringAttributes)" /> 41 41 </UpdateFrom> 42 42 </ObjectGroup> 43 43 </Objects> 44 44 </PublishDatabaseSettings> 45 <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> 45 46 </PropertyGroup> 46 47 <ItemGroup> 47 48 <MSDeployParameterValue Include="$(DeployParameterPrefix)HeuristicLab.Authentication-Web.config Connection String" /> 48 49 <MSDeployParameterValue Include="$(DeployParameterPrefix)HeuristicLab.Services.Hive.DataAccess.Settings.HeuristicLab_Hive_LinqConnectionString-Web.config Connection String"> 49 <ParameterValue>Data Source= localhost;Initial Catalog=HeuristicLab.Hive-3.3;Integrated Security=True</ParameterValue>50 <ParameterValue>Data Source=.\SQLEXPRESS;Initial Catalog=HeuristicLab.Hive-3.3;Integrated Security=True</ParameterValue> 50 51 </MSDeployParameterValue> 51 52 </ItemGroup> -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Web/Hive-3.3/Status.aspx.cs
r11204 r12395 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Web;26 using System.Web.UI;27 25 using System.Web.UI.WebControls; 28 using HeuristicLab.Services.Hive.DataAccess;29 26 using HeuristicLab.Services.Hive; 30 using HeuristicLab.Services.Hive.DataTransfer;31 using System.Text;32 27 using System.Web.UI.DataVisualization.Charting; 33 28 using DA = HeuristicLab.Services.Hive.DataAccess; … … 37 32 protected void Page_Load(object sender, EventArgs e) { 38 33 var dao = ServiceLocator.Instance.HiveDao; 34 var optDao = ServiceLocator.Instance.OptimizedHiveDao; 39 35 var transactionManager = ServiceLocator.Instance.TransactionManager; 40 36 var resourceName = Request.QueryString["resource"]; 41 IEnumerable<Guid> resourceIds = new List<Guid>();42 IEnumerable<DT.Slave> onlineSlaves = new List<DT.Slave>();37 List<Guid> resourceIds = new List<Guid>(); 38 List<DT.Slave> onlineSlaves = new List<DT.Slave>(); 43 39 int currentlyJobsWaiting = 0; 44 Dictionary<Guid, int> calculatingTasksByUser = new Dictionary<Guid, int>();40 Dictionary<Guid, int> calculatingTasksByUser = new Dictionary<Guid, int>(); 45 41 Dictionary<Guid, int> waitingTasksByUser = new Dictionary<Guid, int>(); 46 42 List<DT.Resource> groups = new List<DT.Resource>(); 47 43 48 44 transactionManager.UseTransaction(() => { 49 50 }, false, false); 45 groups = dao.GetResources(x => x.ResourceType == "GROUP").ToList(); 46 }, false, false); 51 47 52 48 if (!string.IsNullOrEmpty(resourceName)) { 53 transactionManager.UseTransaction(() => 54 { 55 var resId = dao.GetResources(x => x.Name == resourceName).Single().Id; 56 resourceIds = dao.GetChildResources(resId).Select(x => x.Id).Union(new List<Guid> { resId }); 57 calculatingTasksByUser = dao.GetCalculatingTasksByUserForResources(resourceIds.ToList()); 58 waitingTasksByUser = dao.GetWaitingTasksByUserForResources(resourceIds.ToList()); 59 }, false, false); 49 transactionManager.UseTransaction(() => { 50 var resId = dao.GetResources(x => x.Name == resourceName).Single().Id; 51 resourceIds = dao.GetChildResources(resId).Select(x => x.Id).Union(new List<Guid> { resId }).ToList(); 52 calculatingTasksByUser = dao.GetCalculatingTasksByUserForResources(resourceIds); 53 waitingTasksByUser = dao.GetWaitingTasksByUserForResources(resourceIds); 54 }, false, false); 60 55 } else { 61 transactionManager.UseTransaction(() => 62 { 63 resourceIds = dao.GetResources(x => true).Select(y => y.Id); 64 calculatingTasksByUser = dao.GetCalculatingTasksByUser(); 65 waitingTasksByUser = dao.GetWaitingTasksByUser(); 66 }, false, false); 67 } 56 transactionManager.UseTransaction(() => { 57 resourceIds = optDao.GetAllResourceIds().ToList(); 58 calculatingTasksByUser = optDao.GetCalculatingTasksByUser(); 59 waitingTasksByUser = optDao.GetWaitingTasksByUser(); 60 }, false, false); 61 } 68 62 69 transactionManager.UseTransaction(() => 70 { 71 onlineSlaves = dao.GetSlaves(x => (x.SlaveState == DA.SlaveState.Calculating || x.SlaveState == DA.SlaveState.Idle) && resourceIds.Contains(x.ResourceId)); 72 currentlyJobsWaiting = dao.GetLightweightTasks(x => x.State == DA.TaskState.Waiting).Count(); 63 transactionManager.UseTransaction(() => { 64 if (string.IsNullOrEmpty(resourceName)) { 65 onlineSlaves = dao.GetSlaves(x => x.SlaveState == DA.SlaveState.Calculating || x.SlaveState == DA.SlaveState.Idle).ToList(); 66 } else { 67 onlineSlaves = dao.GetSlaves(x => (x.SlaveState == DA.SlaveState.Calculating || x.SlaveState == DA.SlaveState.Idle) && resourceIds.Contains(x.ResourceId)).ToList(); 68 } 69 currentlyJobsWaiting = optDao.GetNumberOfWaitingTasks(); 73 70 }, false, false); 74 71 … … 76 73 int currentlyAvailableCores = onlineSlaves.Where(s => s.Cores.HasValue && s.IsAllowedToCalculate).Sum(s => s.Cores.Value); 77 74 int currentlyUsedCores = overallCurrentlyAvailableCores - onlineSlaves.Where(s => s.FreeCores.HasValue).Sum(s => s.FreeCores.Value); 78 75 79 76 this.overallAvailableCoresLabel.Text = overallCurrentlyAvailableCores.ToString(); 80 77 this.availableCoresLabel.Text = currentlyAvailableCores.ToString(); … … 86 83 groupsLabel.Text += string.Join(", ", groups.Select(x => string.Format("<a href=\"?resource={0}\">{0}</a>", x.Name))); 87 84 88 overallCpuUtilizationLabel.Text = (onlineSlaves. Count() > 0? Math.Round(onlineSlaves.Average(s => s.CpuUtilization), 2).ToString() : "0.0") + " %";89 cpuUtilizationLabel.Text = (onlineSlaves. Count() > 0 && onlineSlaves.Where(x => x.IsAllowedToCalculate).Count() > 0? Math.Round(onlineSlaves.Where(x => x.IsAllowedToCalculate).Average(s => s.CpuUtilization), 2).ToString() : "0.0") + " %";85 overallCpuUtilizationLabel.Text = (onlineSlaves.Any() ? Math.Round(onlineSlaves.Average(s => s.CpuUtilization), 2).ToString() : "0.0") + " %"; 86 cpuUtilizationLabel.Text = (onlineSlaves.Any() && onlineSlaves.Any(x => x.IsAllowedToCalculate) ? Math.Round(onlineSlaves.Where(x => x.IsAllowedToCalculate).Average(s => s.CpuUtilization), 2).ToString() : "0.0") + " %"; 90 87 91 DT.Statistics[] stats = new DT.Statistics[0]; 92 transactionManager.UseTransaction(() => 93 { 94 if (daysDropDownList.SelectedValue == "All") { 95 stats = dao.GetStatistics(x => true).OrderBy(x => x.TimeStamp).ToArray(); 96 } else { 97 stats = dao.GetStatistics(x => x.Timestamp >= DateTime.Now.Subtract(TimeSpan.FromDays(int.Parse(daysDropDownList.SelectedValue)))).OrderBy(x => x.TimeStamp).ToArray(); 98 } 88 DT.Statistics[] stats = new DT.Statistics[0]; 89 transactionManager.UseTransaction(() => { 90 if (daysDropDownList.SelectedValue == "All") { 91 stats = dao.GetStatistics(x => true).OrderBy(x => x.TimeStamp).ToArray(); 92 } else { 93 stats = dao.GetStatistics(x => x.Timestamp >= DateTime.Now.Subtract(TimeSpan.FromDays(int.Parse(daysDropDownList.SelectedValue)))).OrderBy(x => x.TimeStamp).ToArray(); 94 } 99 95 }, false, false); 100 96 101 97 for (int i = 0; i < stats.Length; i++) { 102 98 var s = stats[i]; 103 var slaveStats = s.SlaveStatistics.Where(x => resourceIds.Contains(x.SlaveId)) ;99 var slaveStats = s.SlaveStatistics.Where(x => resourceIds.Contains(x.SlaveId)).ToArray(); 104 100 105 var averageCpuUtilization = slaveStats. Count() > 0? slaveStats.Average(x => x.CpuUtilization) : 0.0;101 var averageCpuUtilization = slaveStats.Any() ? slaveStats.Average(x => x.CpuUtilization) : 0.0; 106 102 cpuUtilizationChart.Series[0].Points.Add(new DataPoint(s.TimeStamp.ToOADate(), averageCpuUtilization)); 107 103 … … 118 114 } 119 115 120 GenerateTasksByUserTable(waitingTasksByUser, waitingTasksByUserTable); 121 GenerateTasksByUserTable(calculatingTasksByUser, calculatingTasksByUserTable); 116 GenerateTasksByUserTable(waitingTasksByUser, waitingTasksByUserTable); 117 GenerateTasksByUserTable(calculatingTasksByUser, calculatingTasksByUserTable); 122 118 } 123 119 … … 134 130 table.Rows.Add(curRow); 135 131 } 136 if (tasksByUser. Count() > 0) {137 TableRow sumRow = new TableRow(); 132 if (tasksByUser.Any()) { 133 TableRow sumRow = new TableRow(); 138 134 TableCell sumCell = new TableCell(); 139 135 sumCell.BorderWidth = Unit.Pixel(3); … … 143 139 table.Rows.Add(sumRow); 144 140 } 145 } 141 } 146 142 } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Web/Hive-3.3/Web.config
r9460 r12395 3 3 <configSections> 4 4 <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 5 <section name="HeuristicLab.Services.Hive.DataAccess.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" 5 <section name="HeuristicLab.Services.Hive.DataAccess.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> 6 6 </sectionGroup> 7 7 </configSections> 8 8 9 <connectionStrings> 10 <remove name="HeuristicLab.Authentication" /> 11 <remove name="HeuristicLab.Services.Hive.DataAccess.Settings.HeuristicLab_Hive_LinqConnectionString" /> 12 <add name="HeuristicLab.Authentication" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Authentication" /> 13 <add name="HeuristicLab.Services.Hive.DataAccess.Settings.HeuristicLab_Hive_LinqConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=HeuristicLab.Hive-3.3;Integrated Security=True;" providerName="System.Data.SqlClient" /> 14 </connectionStrings> 15 9 16 <appSettings> 10 <add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" 17 <add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;"/> 11 18 </appSettings> 12 19 <applicationSettings> 13 20 <HeuristicLab.Services.Hive.DataAccess.Settings> 14 21 <setting name="LongRunningDatabaseCommandTimeout" serializeAs="String"> 15 22 <value>00:05:00</value> … … 20 27 </HeuristicLab.Services.Hive.DataAccess.Settings> 21 28 </applicationSettings> 22 <connectionStrings> 23 <add name="HeuristicLab.Authentication" connectionString="data source=localhost;Integrated Security=SSPI;Initial Catalog=HeuristicLab.Authentication"/> 24 <add name="HeuristicLab.Services.Hive.DataAccess.Settings.HeuristicLab_Hive_LinqConnectionString" 25 connectionString="Data Source=localhost;Initial Catalog=HeuristicLab.Hive-3.3;Integrated Security=True;" 26 providerName="System.Data.SqlClient" /> 27 </connectionStrings> 29 30 <!-- 31 For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367. 32 33 The following attributes can be set on the <httpRuntime> tag. 34 <system.Web> 35 <httpRuntime targetFramework="4.5" /> 36 </system.Web> 37 --> 28 38 <system.web> 29 <authentication mode="Forms" 30 <compilation debug="true" targetFramework="4. 0">39 <authentication mode="Forms"/> 40 <compilation debug="true" targetFramework="4.5"> 31 41 <assemblies> 32 42 <add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> … … 35 45 <membership> 36 46 <providers> 37 <clear />38 <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="HeuristicLab.Authentication" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="HeuristicLab.Authentication" />47 <clear /> 48 <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="HeuristicLab.Authentication" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="HeuristicLab.Authentication" /> 39 49 </providers> 40 50 </membership> 41 51 <roleManager enabled="true"> 42 52 <providers> 43 <clear />44 <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="HeuristicLab.Authentication" applicationName="HeuristicLab.Authentication" />53 <clear /> 54 <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="HeuristicLab.Authentication" applicationName="HeuristicLab.Authentication" /> 45 55 </providers> 46 56 </roleManager> 47 57 <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"> 48 58 <controls> 49 <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" 50 assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 59 <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 51 60 </controls> 52 61 </pages> … … 60 69 <wsHttpBinding> 61 70 <binding name="WSHttpBinding_IHiveService" messageEncoding="Mtom" receiveTimeout="00:15:00" sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"> 62 <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" 71 <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/> 63 72 <security mode="Message"> 64 73 <transport clientCredentialType="Certificate"/> … … 69 78 <netTcpBinding> 70 79 <binding name="NetTcpBinding_IHiveService" portSharingEnabled="true" receiveTimeout="00:15:00" sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"> 71 <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" 80 <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/> 72 81 <security mode="TransportWithMessageCredential"> 73 82 <transport clientCredentialType="Certificate"/> … … 100 109 <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" name="MexTcpEndpoint" contract="IMetadataExchange"/> 101 110 <endpoint address="" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IHiveService" name="WSHttpBinding_IHiveService" contract="HeuristicLab.Services.Hive.ServiceContracts.IHiveService"/> 102 <endpoint address="net.tcp:// testhive.fh-hagenberg.at/Hive-3.3/HiveService.svc" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IHiveService" name="NetBinding_IHiveService" contract="HeuristicLab.Services.Hive.ServiceContracts.IHiveService"/>111 <endpoint address="net.tcp://localhost/Hive-3.3/HiveService.svc" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IHiveService" name="NetBinding_IHiveService" contract="HeuristicLab.Services.Hive.ServiceContracts.IHiveService"/> 103 112 </service> 104 113 </services> … … 106 115 </system.serviceModel> 107 116 <system.webServer> 108 <directoryBrowse enabled="true" 117 <directoryBrowse enabled="true"/> 109 118 <handlers> 110 <remove name="ChartImageHandler" /> 111 <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" 112 path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 119 <remove name="ChartImageHandler"/> 120 <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 113 121 </handlers> 114 </system.webServer> 122 </system.webServer> 115 123 </configuration> -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Web/Hive-3.3/website.publishproj
r9589 r12395 21 21 <SourceWebVirtualPath>/Hive-3.3</SourceWebVirtualPath> 22 22 <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 23 <SourceWebProject> 24 </SourceWebProject> 25 <SourceWebMetabasePath> 26 </SourceWebMetabasePath> 23 <SourceWebProject>C:\dglaser\HiveStatistics\sources\HeuristicLab.Services.Hive.Web\Hive-3.3</SourceWebProject> 24 <SourceWebMetabasePath>/IISExpress/7.5/LM/W3SVC/4/ROOT</SourceWebMetabasePath> 27 25 </PropertyGroup> 28 26 <PropertyGroup>
Note: See TracChangeset
for help on using the changeset viewer.