Changeset 11259
- Timestamp:
- 08/04/14 13:01:40 (10 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml
r11222 r11259 288 288 <Column Name="TotalTimeOffline" Type="System.Double" DbType="Float NOT NULL" CanBeNull="false" /> 289 289 <Column Name="TotalTimeUnavailable" Type="System.Double" DbType="Float NOT NULL" CanBeNull="false" /> 290 <Column Name="SlaveState" Type="global::HeuristicLab.Services.Hive.DataAccess.SlaveState" DbType="VarChar(15)" CanBeNull="false" /> 290 291 <Association Name="DimClient_FactClientInfo" Member="DimClient" ThisKey="ClientId" OtherKey="Id" Type="DimClient" IsForeignKey="true" /> 291 292 <Association Name="DimTime_FactClientInfo" Member="DimTime" ThisKey="Time" OtherKey="Time" Type="DimTime" IsForeignKey="true" /> -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout
r11222 r11259 200 200 </nodes> 201 201 </associationConnector> 202 <associationConnector edgePoints="[(6.5 : 1.69314697265625); (6.125 : 1.69314697265625)]" fixedFrom=" Algorithm" fixedTo="Algorithm">202 <associationConnector edgePoints="[(6.5 : 1.69314697265625); (6.125 : 1.69314697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 203 203 <AssociationMoniker Name="/HiveDataContext/Task/Task_TaskData" /> 204 204 <nodes> … … 207 207 </nodes> 208 208 </associationConnector> 209 <associationConnector edgePoints="[(6.5 : 2.50564697265625); (3.75 : 2.50564697265625)]" fixedFrom=" Algorithm" fixedTo="Algorithm">209 <associationConnector edgePoints="[(6.5 : 2.50564697265625); (3.75 : 2.50564697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 210 210 <AssociationMoniker Name="/HiveDataContext/Task/Task_StateLog" /> 211 211 <nodes> … … 277 277 </nestedChildShapes> 278 278 </classShape> 279 <classShape Id="053a5cff-b18a-4ee5-8d43-48ed5c5dcfad" absoluteBounds="2.625, 11, 2, 3. 3093082682291666">279 <classShape Id="053a5cff-b18a-4ee5-8d43-48ed5c5dcfad" absoluteBounds="2.625, 11, 2, 3.5016097005208326"> 280 280 <DataClassMoniker Name="/HiveDataContext/FactClientInfo" /> 281 281 <nestedChildShapes> 282 <elementListCompartment Id="0a1cc913-6636-455c-95b3-302f533527db" absoluteBounds="2.6399999999999997, 11.46, 1.9700000000000002, 2. 7493082682291665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />282 <elementListCompartment Id="0a1cc913-6636-455c-95b3-302f533527db" absoluteBounds="2.6399999999999997, 11.46, 1.9700000000000002, 2.941609700520833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 283 283 </nestedChildShapes> 284 284 </classShape> … … 290 290 </nodes> 291 291 </associationConnector> 292 <associationConnector edgePoints="[(8.5 : 10.7035953776042); (8.5 : 11.25)]" fixedFrom=" Algorithm" fixedTo="Algorithm">292 <associationConnector edgePoints="[(8.5 : 10.7035953776042); (8.5 : 11.25)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 293 293 <AssociationMoniker Name="/HiveDataContext/DimJob/DimJob_FactTask" /> 294 294 <nodes> … … 297 297 </nodes> 298 298 </associationConnector> 299 <associationConnector edgePoints="[(5.02343625 : 10.2708968098958); (5.02343625 : 14. 6266072005208); (5.90885291666667 : 14.6266072005208 : JumpStart); (6.07551958333333 : 14.6266072005208 : JumpEnd); (6.875 : 14.6266072005208)]" fixedFrom="Algorithm" fixedTo="Algorithm">299 <associationConnector edgePoints="[(5.02343625 : 10.2708968098958); (5.02343625 : 14.7227579166667); (6.875 : 14.7227579166667)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 300 300 <AssociationMoniker Name="/HiveDataContext/DimTime/DimTime_FactTask" /> 301 301 <nodes> … … 311 311 </nodes> 312 312 </associationConnector> 313 <associationConnector edgePoints="[(5.99218625 : 15.25); (5.99218625 : 12.1788329785157); (5.50521083333333 : 12.1788329785157 : JumpStart); (5.33854416666667 : 12.1788329785157 : JumpEnd); (5.10676958333333 : 12.1788329785157 : JumpStart); (4.94010291666667 : 12.1788329785157 : JumpEnd); (4.625 : 12.1788329785157)]" fixedFrom=" Algorithm" fixedTo="Algorithm">313 <associationConnector edgePoints="[(5.99218625 : 15.25); (5.99218625 : 12.1788329785157); (5.50521083333333 : 12.1788329785157 : JumpStart); (5.33854416666667 : 12.1788329785157 : JumpEnd); (5.10676958333333 : 12.1788329785157 : JumpStart); (4.94010291666667 : 12.1788329785157 : JumpEnd); (4.625 : 12.1788329785157)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 314 314 <AssociationMoniker Name="/HiveDataContext/DimClient/DimClient_FactClientInfo" /> 315 315 <nodes> … … 318 318 </nodes> 319 319 </associationConnector> 320 <associationConnector edgePoints="[(4.125 : 10.2708968098958); (4.125 : 11)]" fixedFrom=" Algorithm" fixedTo="Algorithm">320 <associationConnector edgePoints="[(4.125 : 10.2708968098958); (4.125 : 11)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 321 321 <AssociationMoniker Name="/HiveDataContext/DimTime/DimTime_FactClientInfo" /> 322 322 <nodes> … … 325 325 </nodes> 326 326 </associationConnector> 327 <associationConnector edgePoints="[(1.59375 : 10.0689925130208); (1.59375 : 12. 6546541341146); (2.625 : 12.6546541341146)]" fixedFrom="Algorithm" fixedTo="Algorithm">327 <associationConnector edgePoints="[(1.59375 : 10.0689925130208); (1.59375 : 12.7508048502604); (2.625 : 12.7508048502604)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 328 328 <AssociationMoniker Name="/HiveDataContext/DimUser/DimUser_FactClientInfo" /> 329 329 <nodes> -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs
r11222 r11259 5951 5951 private double _TotalTimeUnavailable; 5952 5952 5953 private global::HeuristicLab.Services.Hive.DataAccess.SlaveState _SlaveState; 5954 5953 5955 private EntityRef<DimClient> _DimClient; 5954 5956 … … 5987 5989 partial void OnTotalTimeUnavailableChanging(double value); 5988 5990 partial void OnTotalTimeUnavailableChanged(); 5991 partial void OnSlaveStateChanging(global::HeuristicLab.Services.Hive.DataAccess.SlaveState value); 5992 partial void OnSlaveStateChanged(); 5989 5993 #endregion 5990 5994 … … 6269 6273 } 6270 6274 6275 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SlaveState", DbType="VarChar(15)", CanBeNull=false)] 6276 public global::HeuristicLab.Services.Hive.DataAccess.SlaveState SlaveState 6277 { 6278 get 6279 { 6280 return this._SlaveState; 6281 } 6282 set 6283 { 6284 if ((this._SlaveState != value)) 6285 { 6286 this.OnSlaveStateChanging(value); 6287 this.SendPropertyChanging(); 6288 this._SlaveState = value; 6289 this.SendPropertyChanged("SlaveState"); 6290 this.OnSlaveStateChanged(); 6291 } 6292 } 6293 } 6294 6271 6295 [global::System.Data.Linq.Mapping.AssociationAttribute(Name="DimClient_FactClientInfo", Storage="_DimClient", ThisKey="ClientId", OtherKey="Id", IsForeignKey=true)] 6272 6296 public DimClient DimClient -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql
r11222 r11259 239 239 [TotalMemory] INT NOT NULL, 240 240 [CpuUtilization] FLOAT (53) NOT NULL, 241 [SlaveState] VarChar(15) NOT NULL, 241 242 [TotalTimeIdle] FLOAT (53) NOT NULL, 242 243 [TotalTimeCalculating] FLOAT (53) NOT NULL, -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ChartHelper.cshtml
r11252 r11259 448 448 } 449 449 450 @helper CreateStreamChart(string dataName, string destinationTag, string url, string title, string format = null, double? maxY = null)450 @helper CreateStreamChart(string dataName, string destinationTag, string url, string title, string slaveState, string format = null, double? maxY = null) 451 451 { 452 452 <text> … … 459 459 //Get the most recent value(s) from the given URL 460 460 $.ajax({ 461 async: false, url: '@(url)', datatype: "json", success: function (result) {461 async: false, url: "@(url)?state=" + @(slaveState), datatype: "json", success: function (result) { 462 462 for(i = 0; i < result.length; i++) { 463 463 @(dataName)CurrentValue[i] = result[i]; … … 531 531 } 532 532 533 @helper UpdateStreamChart(string dataName, string destinationTag, string url, string fixedY = null)533 @helper UpdateStreamChart(string dataName, string destinationTag, string url, string slaveState, string fixedY = null) 534 534 { 535 535 <text> … … 543 543 //Get the up-to-date data, each result assigned to it's own array 544 544 $.ajax({ 545 async: false, url: '@(url)', datatype: "json", success: function (result) {545 async: false, url: "@(url)?state=" + @(slaveState), datatype: "json", success: function (result) { 546 546 for(i = 0; i < result.length; i++) { 547 547 window[ "@(dataName)Data" + i].push([(new Date()).getTime(), result[i]]); -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Content/Site.css
r11252 r11259 560 560 } 561 561 562 label.slaveStateFilter { 563 margin-left: 2%; 564 display: inline; 565 } 566 567 select.slaveStateFilter { 568 margin-top: 2%; 569 display: inline; 570 } 571 562 572 /* User Page Styles*/ 563 573 #TasksContainer div[id^="Task"] { … … 579 589 } 580 590 581 .chartContainer > label:first-of-type , .moreTaskInfo {591 .chartContainer > label:first-of-type:not(.slaveStateFilter), .moreTaskInfo { 582 592 margin-bottom: 1%; 583 593 display: block; -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/ChartDataController.cs
r11255 r11259 92 92 } 93 93 94 public JsonResult CurrentCpuUtilization( )94 public JsonResult CurrentCpuUtilization(string state) 95 95 { 96 96 using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) … … 102 102 on clients.ResourceId equals resource.ResourceId 103 103 where clients.ExpirationTime == null && 104 (resource.SlaveState == SlaveState.Calculating || resource.SlaveState == SlaveState.Idle) 104 (state == "All") || 105 (state == "Online") && 106 (client.SlaveState == SlaveState.Idle || client.SlaveState == SlaveState.Calculating ) || 107 (state == "Available") && 108 (client.SlaveState == SlaveState.Idle) 105 109 select new { client.ClientId, client.CpuUtilization, client.Time }) 106 110 .OrderBy(c => c.Time).GroupBy(c => c.ClientId).ToList(); … … 113 117 } 114 118 115 public JsonResult CurrentCores( )119 public JsonResult CurrentCores(string state) 116 120 { 117 121 using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) … … 123 127 on clients.ResourceId equals resource.ResourceId 124 128 where clients.ExpirationTime == null && 125 (resource.SlaveState == SlaveState.Calculating || resource.SlaveState == SlaveState.Idle) 129 (state == "All") || 130 (state == "Online") && 131 (client.SlaveState == SlaveState.Idle || client.SlaveState == SlaveState.Calculating) || 132 (state == "Available") && 133 (client.SlaveState == SlaveState.Idle) 126 134 select new { client.ClientId, client.NumTotalCores, client.NumUsedCores, client.Time }) 127 135 .OrderBy(c => c.Time).GroupBy(c => c.ClientId).ToList(); … … 135 143 } 136 144 137 public JsonResult CurrentMemory( )145 public JsonResult CurrentMemory(string state) 138 146 { 139 147 using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) … … 145 153 on clients.ResourceId equals resource.ResourceId 146 154 where clients.ExpirationTime == null && 147 (resource.SlaveState == SlaveState.Calculating || resource.SlaveState == SlaveState.Idle) 155 (state == "All") || 156 (state == "Online") && 157 (client.SlaveState == SlaveState.Idle || client.SlaveState == SlaveState.Calculating) || 158 (state == "Available") && 159 (client.SlaveState == SlaveState.Idle) 148 160 select new { client.ClientId, client.TotalMemory, client.UsedMemory, client.Time }) 149 161 .OrderBy(c => c.Time).GroupBy(c => c.ClientId).ToList(); -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Scripts/CollapsingSection.js
r11222 r11259 3 3 $(".collapse").click(function () { 4 4 if ($(this).html() == "-") { 5 $(this).parent().children("canvas, div, fieldset, label, .chartContainer, a, table ").fadeOut();5 $(this).parent().children("canvas, div, fieldset, label, .chartContainer, a, table, select").fadeOut(); 6 6 $(this).html("+"); 7 7 } 8 8 else { 9 $(this).parent().children("canvas, div, fieldset, label, .chartContainer, a, table ").fadeIn();9 $(this).parent().children("canvas, div, fieldset, label, .chartContainer, a, table, select").fadeIn(); 10 10 $(this).html("-"); 11 11 } … … 18 18 var jqCaller = $(caller); 19 19 if (jqCaller.html() == "-") { 20 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, a, table ").fadeOut();20 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, a, table, select").fadeOut(); 21 21 jqCaller.html("+"); 22 22 } 23 23 else { 24 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, a, table ").fadeIn();24 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, a, table, select").fadeIn(); 25 25 jqCaller.html("-"); 26 26 } … … 30 30 section */ 31 31 function CollapsedByDefault(caller) { 32 $(caller).parent().children("canvas, div, fieldset, label, .chartContainer, a, table ").hide();32 $(caller).parent().children("canvas, div, fieldset, label, .chartContainer, a, table, select").hide(); 33 33 } 34 34 … … 36 36 function OpenOnError(caller) { 37 37 var jqCaller = $(caller); 38 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, a, table ").fadeIn();38 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, a, table, select").fadeIn(); 39 39 jqCaller.parent().children("button").html("-"); 40 40 } … … 45 45 var jqCaller = $(caller); 46 46 if (jqCaller.html() == "-") { 47 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, .tabSection, a, table ").hide();47 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, .tabSection, a, table, select").hide(); 48 48 jqCaller.html("+"); 49 49 } 50 50 else { 51 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, .tabSection, a, table ").show();51 jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, .tabSection, a, table, select").show(); 52 52 jqCaller.html("-"); 53 53 } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/Home/Index.cshtml
r11252 r11259 31 31 <h1 class="title">Current Hive Status</h1> 32 32 <button class="collapse">-</button> 33 <label class="slaveStateFilter">Slave State:</label> 34 <select id="SlaveState" class="slaveStateFilter"> 35 <option>All</option> 36 <option selected="selected">Online</option> 37 <option>Available</option> 38 </select> 33 39 <div id="CurrentCPUUtilization"></div> 34 40 <div id="CurrentTotalUsedCores"></div> … … 104 110 RefreshCharts(); 105 111 }); 112 113 106 114 }); 107 115 … … 116 124 117 125 $(document).ready(function () { 126 var slaveState; 127 slaveState = $("#SlaveState").val(); 128 129 $("#SlaveState").change(function () { 130 slaveState = $(this).val(); 131 }); 132 118 133 @ChartHelper.UserTasks(Url.Action("UserTasks", "ChartData"), "section.currentStats", "Calculating"); 119 134 @ChartHelper.UserTasks(Url.Action("UserTasks", "ChartData"), "section.currentStats", "Waiting"); … … 121 136 @ChartHelper.SetStreamingProperties(1000,20,5) 122 137 123 @ChartHelper.CreateStreamChart("CurrentCPU", "CurrentCPUUtilization",Url.Action("CurrentCpuUtilization","ChartData"),"Current CPU Utilization"," %.2f%%",100.00)124 @ChartHelper.CreateStreamChart("CurrentCores", "CurrentTotalUsedCores",Url.Action("CurrentCores","ChartData"),"Current Total vs. Used Cores" )125 @ChartHelper.CreateStreamChart("CurrentMemory", "CurrentTotalUsedMemory",Url.Action("CurrentMemory","ChartData"),"Current Total vs. Used Memory" )138 @ChartHelper.CreateStreamChart("CurrentCPU", "CurrentCPUUtilization",Url.Action("CurrentCpuUtilization","ChartData"),"Current CPU Utilization","slaveState","%.2f%%",100.00) 139 @ChartHelper.CreateStreamChart("CurrentCores", "CurrentTotalUsedCores",Url.Action("CurrentCores","ChartData"),"Current Total vs. Used Cores","slaveState") 140 @ChartHelper.CreateStreamChart("CurrentMemory", "CurrentTotalUsedMemory",Url.Action("CurrentMemory","ChartData"),"Current Total vs. Used Memory","slaveState") 126 141 127 142 function DoUpdate() { 128 @ChartHelper.UpdateStreamChart("CurrentCPU","CurrentCPUUtilization", Url.Action("CurrentCpuUtilization","ChartData")," FixedY")129 @ChartHelper.UpdateStreamChart("CurrentCores","CurrentTotalUsedCores", Url.Action("CurrentCores","ChartData") )130 @ChartHelper.UpdateStreamChart("CurrentMemory","CurrentTotalUsedMemory", Url.Action("CurrentMemory","ChartData") )143 @ChartHelper.UpdateStreamChart("CurrentCPU","CurrentCPUUtilization", Url.Action("CurrentCpuUtilization","ChartData"),"slaveState","FixedY") 144 @ChartHelper.UpdateStreamChart("CurrentCores","CurrentTotalUsedCores", Url.Action("CurrentCores","ChartData"),"slaveState") 145 @ChartHelper.UpdateStreamChart("CurrentMemory","CurrentTotalUsedMemory", Url.Action("CurrentMemory","ChartData"),"slaveState") 131 146 setTimeout(DoUpdate, refreshRate); 132 147 } -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs
r11223 r11259 200 200 TotalMemory = s.Slave.Memory ?? 0, 201 201 CpuUtilization = s.Slave.CpuUtilization, 202 SlaveState = s.Slave.SlaveState, 202 203 TotalTimeIdle = s.Slave.SlaveState == SlaveState.Idle && s.Slave.IsAllowedToCalculate 203 204 ? duration : 0.0,
Note: See TracChangeset
for help on using the changeset viewer.