Changeset 9025
- Timestamp:
- 12/11/12 16:27:46 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Services.Hive.Web/Hive-3.3/Status.aspx
r9023 r9025 37 37 <asp:Label ID="slavesLabel" runat="server" /> 38 38 <br /> 39 Groups: 40 <asp:Label ID="groupsLabel" runat="server" /> 41 <br /> 39 42 <br /> 40 43 Number of Calculating Tasks by User:<asp:Table ID="calculatingTasksByUserTable" runat="server" GridLines="Both"> … … 74 77 <br /> 75 78 Avg. CPU Utilization History of all Slaves<br /> 76 <asp:Chart ID="cpuUtilizationChart" runat="server" Height="270px" Width="1 900px">79 <asp:Chart ID="cpuUtilizationChart" runat="server" Height="270px" Width="1280px"> 77 80 <Series> 78 81 <asp:Series BorderWidth="2" ChartType="Line" Color="0, 176, 80" Name="Series1" XValueType="DateTime" … … 96 99 <br /> 97 100 Cores/Used Cores History<br /> 98 <asp:Chart ID="coresChart" runat="server" Palette="None" Width="1 900px" PaletteCustomColors="137, 165, 78; 185, 205, 150">101 <asp:Chart ID="coresChart" runat="server" Palette="None" Width="1280px" PaletteCustomColors="137, 165, 78; 185, 205, 150"> 99 102 <Series> 100 103 <asp:Series ChartType="Area" Name="Cores" XValueType="DateTime" YValueType="Double"> … … 121 124 Memory/Used Memory History (GB)<br /> 122 125 <asp:Chart ID="memoryChart" runat="server" Palette="None" PaletteCustomColors="170, 70, 67; 209, 147, 146" 123 Width="1 900px">126 Width="1280px"> 124 127 <Series> 125 128 <asp:Series ChartType="Area" Name="Cores" XValueType="DateTime" YValueType="Double"> -
trunk/sources/HeuristicLab.Services.Hive.Web/Hive-3.3/Status.aspx.cs
r9023 r9025 44 44 Dictionary<Guid, int> calculatingTasksByUser = new Dictionary<Guid,int>(); 45 45 Dictionary<Guid, int> waitingTasksByUser = new Dictionary<Guid, int>(); 46 List<DT.Resource> groups = new List<DT.Resource>(); 47 48 transactionManager.UseTransaction(() => { 49 groups = dao.GetResources(x => x.ResourceType == "GROUP").ToList(); 50 }, false, false); 46 51 47 52 if (!string.IsNullOrEmpty(resourceName)) { … … 76 81 77 82 slavesLabel.Text = string.Join(", ", onlineSlaves.Select(x => string.Format("<a href=\"?resource={0}\">{0}</a> ({1} %)", x.Name, Math.Round(x.CpuUtilization, 2)))); 83 groupsLabel.Text = string.Join(", ", groups.Select(x => string.Format("<a href=\"?resource={0}\">{0}</a>", x.Name))); 78 84 79 85 overallCpuUtilizationLabel.Text = (onlineSlaves.Count() > 0 ? Math.Round(onlineSlaves.Average(s => s.CpuUtilization), 2).ToString() : "0.0") + " %"; 80 cpuUtilizationLabel.Text = (onlineSlaves.Count() > 0 ? Math.Round(onlineSlaves.Where(x => x.IsAllowedToCalculate).Average(s => s.CpuUtilization), 2).ToString() : "0.0") + " %";86 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") + " %"; 81 87 82 88 DT.Statistics[] stats = new DT.Statistics[0]; -
trunk/sources/HeuristicLab.Services.Hive/3.3/HiveDao.cs
r9022 r9025 639 639 public IEnumerable<DT.Resource> GetChildResources(Guid resourceId) { 640 640 using (var db = CreateContext()) { 641 var childs = new List<DT.Resource>(); 642 foreach (var child in db.Resources.Where(x => x.ParentResourceId == resourceId)) { 643 childs.Add(DT.Convert.ToDto(child)); 644 childs.AddRange(GetChildResources(child.ResourceId)); 645 } 646 return childs; 647 } 641 return CollectChildResources(resourceId, db); 642 } 643 } 644 645 public IEnumerable<DT.Resource> CollectChildResources(Guid resourceId, HiveDataContext db) { 646 var childs = new List<DT.Resource>(); 647 foreach (var child in db.Resources.Where(x => x.ParentResourceId == resourceId)) { 648 childs.Add(DT.Convert.ToDto(child)); 649 childs.AddRange(CollectChildResources(child.ResourceId, db)); 650 } 651 return childs; 648 652 } 649 653 … … 842 846 using (var db = CreateContext()) { 843 847 var calculatingTasksByUser = from task in db.Tasks 844 where task.State == TaskState.Calculating845 group task by task.Job.OwnerUserId into g846 select new { UserId = g.Key, UsedCores = g.Count() };848 where task.State == TaskState.Calculating 849 group task by task.Job.OwnerUserId into g 850 select new { UserId = g.Key, UsedCores = g.Count() }; 847 851 return calculatingTasksByUser.ToDictionary(x => x.UserId, x => x.UsedCores); 848 852 }
Note: See TracChangeset
for help on using the changeset viewer.