- Timestamp:
- 07/31/14 16:37:29 (10 years ago)
- Location:
- branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ChartHelper.cshtml
r11246 r11252 478 478 var @(destinationTag)PlotOptions = { 479 479 title: "@title", 480 highlighter: { 481 show: true, 482 sizeAdjust: 7.5 483 }, 480 484 axes: { 481 485 xaxis: { … … 502 506 @:max: window["@(dataName)Data" + 0][window["@(dataName)Data" + 0].length - 1][1] + upperYBuffer, 503 507 } 504 numberTicks: 6508 numberTicks: 5 505 509 } 506 510 }, … … 510 514 show: false 511 515 } 516 }, 517 cursor: { 518 show: true, 519 showTooltip: false, 520 zoom: true, 521 clickReset: false, 522 dblClickReset: false, 523 constrainZoomTo: 'x' 512 524 } 513 525 }; … … 836 848 '<button class="collapse" onclick="CollapseSection(this)">-</button>' + 837 849 '<div id="UserTask@(taskState)Plot" class="noXTicks"></div>' + 850 '<label id="UserTask@(taskState)PlotInfo"></label>' + 838 851 '</section>' 839 852 ); 840 853 } 841 854 var userTasks = []; 855 var userNameLabels = []; 842 856 var userNames = []; 843 857 for (i=0; i < result.length; i++) { 844 858 userTasks[i] = [result[i].Value]; 845 userNames[i] = { label: result[i].Key }; 859 userNameLabels[i] = { label: result[i].Key }; 860 userNames[i] = result[i].Key; 846 861 } 847 862 window["UserTask@(taskState)Plot"] = $.jqplot("UserTask@(taskState)Plot", userTasks, { … … 852 867 pointLabels: {show: true, formatString: '%.3f'} 853 868 }, 854 series: userName s,869 series: userNameLabels, 855 870 legend: { 856 871 show: true, … … 872 887 } 873 888 }); 889 /* Bind a datalistener to each chart and display details of clicked 890 upon data in the label below the chart */ 891 $("#UserTask" + "@(taskState)Plot").bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) { 892 $(this).next("label").html(userNames[seriesIndex] + " Tasks @(taskState): " + data[1]); 893 }); 874 894 }}); 875 895 </text> -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Content/Site.css
r11246 r11252 555 555 } 556 556 557 label[id^="UserTask"][id$="PlotInfo"] { 558 margin-top: 2%; 559 padding-left: 2%; 560 } 561 557 562 /* User Page Styles*/ 558 563 #TasksContainer div[id^="Task"] { -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/ChartDataController.cs
r11246 r11252 92 92 } 93 93 94 public JsonResult CurrentCpuUtilization() 95 { 96 using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) 97 { 98 var currentCpuUtil = (from client in db.FactClientInfos 99 join clients in db.DimClients 100 on client.ClientId equals clients.Id 101 where clients.ExpirationTime == null 102 select new { client.ClientId, client.CpuUtilization, client.Time }) 103 .OrderBy(c => c.Time).GroupBy(c => c.ClientId).ToList(); 104 105 List<double> result = new List<double>(); 106 result.Add(Math.Round(currentCpuUtil.Average(s => s.Last().CpuUtilization), 2)); 107 108 return Json(result, JsonRequestBehavior.AllowGet); 109 } 110 } 111 94 112 public JsonResult CurrentCores() 95 113 { … … 97 115 { 98 116 var currentCores = (from client in db.FactClientInfos 99 select new { client.NumTotalCores, client.NumUsedCores }) 100 .ToList(); 117 join clients in db.DimClients 118 on client.ClientId equals clients.Id 119 where clients.ExpirationTime == null 120 select new { client.ClientId, client.NumTotalCores, client.NumUsedCores, client.Time }) 121 .OrderBy(c => c.Time).GroupBy(c => c.ClientId).ToList(); 101 122 102 123 List<int> result = new List<int>(); 103 result.Add(currentCores.Sum(c => c. NumTotalCores));104 result.Add(currentCores.Sum(s => s. NumUsedCores));124 result.Add(currentCores.Sum(c => c.Last().NumTotalCores)); 125 result.Add(currentCores.Sum(s => s.Last().NumUsedCores)); 105 126 106 127 return Json(result, JsonRequestBehavior.AllowGet); … … 108 129 } 109 130 110 public JsonResult CurrentCpuUtilization()111 {112 using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString))113 {114 var currentCpuUtil = (from client in db.FactClientInfos115 select new { client.CpuUtilization })116 .ToList();117 118 List<double> result = new List<double>();119 result.Add(Math.Round(currentCpuUtil.Average(s => s.CpuUtilization), 2));120 121 return Json(result, JsonRequestBehavior.AllowGet);122 }123 }124 125 131 public JsonResult CurrentMemory() 126 132 { … … 128 134 { 129 135 var currentMemory = (from client in db.FactClientInfos 130 select new { client.TotalMemory, client.UsedMemory }) 131 .ToList(); 136 join clients in db.DimClients 137 on client.ClientId equals clients.Id 138 where clients.ExpirationTime == null 139 select new { client.ClientId, client.TotalMemory, client.UsedMemory, client.Time }) 140 .OrderBy(c => c.Time).GroupBy(c => c.ClientId).ToList(); 132 141 133 142 List<int> result = new List<int>(); 134 result.Add(currentMemory.Sum(c => c. TotalMemory)/1000);135 result.Add(currentMemory.Sum(s => s. UsedMemory)/1000);143 result.Add(currentMemory.Sum(c => c.Last().TotalMemory)/1000); 144 result.Add(currentMemory.Sum(s => s.Last().UsedMemory)/1000); 136 145 137 146 return Json(result, JsonRequestBehavior.AllowGet); -
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/Home/Index.cshtml
r11246 r11252 104 104 RefreshCharts(); 105 105 }); 106 107 @ChartHelper.UserTasks(Url.Action("UserTasks", "ChartData"), "section.currentStats", "Calculating");108 @ChartHelper.UserTasks(Url.Action("UserTasks", "ChartData"), "section.currentStats", "Waiting");109 106 }); 110 107 … … 119 116 120 117 $(document).ready(function () { 121 @ChartHelper.SetStreamingProperties(1000,20,10) 118 @ChartHelper.UserTasks(Url.Action("UserTasks", "ChartData"), "section.currentStats", "Calculating"); 119 @ChartHelper.UserTasks(Url.Action("UserTasks", "ChartData"), "section.currentStats", "Waiting"); 120 121 @ChartHelper.SetStreamingProperties(1000,20,5) 122 122 123 123 @ChartHelper.CreateStreamChart("CurrentCPU", "CurrentCPUUtilization",Url.Action("CurrentCpuUtilization","ChartData"),"Current CPU Utilization","%.2f%%",100.00)
Note: See TracChangeset
for help on using the changeset viewer.