1 | @model HeuristicLab.Services.Hive.Statistics.Models.OverallStatus
|
---|
2 |
|
---|
3 | @{
|
---|
4 | ViewBag.Title = "Status Monitor";
|
---|
5 | }
|
---|
6 |
|
---|
7 | <h1>Current Status</h1>
|
---|
8 | <section class="chartContainer">
|
---|
9 | <h1 class="title">Current Hive Status</h1>
|
---|
10 | <button class="collapse">-</button>
|
---|
11 | <div id="CurrentCPUUtilization"></div>
|
---|
12 | <div id="CurrentTotalUsedCores"></div>
|
---|
13 | <div id="CurrentTotalUsedMemory"></div>
|
---|
14 | </section>
|
---|
15 |
|
---|
16 | <section class="chartContainer">
|
---|
17 | <h1 class="title">Historic Hive Status</h1>
|
---|
18 | <button class="collapse">-</button>
|
---|
19 | <fieldset>
|
---|
20 | <legend>Range</legend>
|
---|
21 | <label>Start</label>
|
---|
22 | @Html.TextBox("Start", (DateTime.Now - new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" })
|
---|
23 | <label>End</label>
|
---|
24 | @Html.TextBox("End", (DateTime.Now + new TimeSpan(1, 0, 0, 0)).ToString("yyyy-MM-dd"), new { @class = "date" })
|
---|
25 | <button id="Refresh">Refresh</button>
|
---|
26 | </fieldset>
|
---|
27 | <div id="AverageCpuUtilization"></div>
|
---|
28 | <div id="UsedCores"></div>
|
---|
29 | <div id="UsedMemory"></div>
|
---|
30 | </section>
|
---|
31 |
|
---|
32 | @section Styles {
|
---|
33 | @Styles.Render("~/Styles/jqPlot/jquery.jqplot")
|
---|
34 | @Styles.Render("~/Content/themes/base/css")
|
---|
35 | }
|
---|
36 |
|
---|
37 | @section Scripts {
|
---|
38 | @Scripts.Render("~/bundles/jqueryui")
|
---|
39 | @Scripts.Render("~/Scripts/smoothie.js")
|
---|
40 | @Scripts.Render("~/Scripts/SmoothieChartResize.js")
|
---|
41 | @Scripts.Render("~/Scripts/CollapsingSection.js")
|
---|
42 | <script>
|
---|
43 | $("#Refresh").button({
|
---|
44 | icons: {
|
---|
45 | primary: "ui-icon-refresh"
|
---|
46 | }
|
---|
47 | });
|
---|
48 | </script>
|
---|
49 |
|
---|
50 | @Scripts.Render("~/Scripts/jqPlot/jquery.jqplot")
|
---|
51 | @ChartHelper.AjaxDataRenderer()
|
---|
52 |
|
---|
53 | @ChartHelper.LineChartTime(
|
---|
54 | "AverageCpuUtilization",
|
---|
55 | Url.Action("AverageCpuUtilization", "ChartData"),
|
---|
56 | title: "Avg. CPU Utilization History of all Slaves",
|
---|
57 | axisYFormat: "%.2f%%",
|
---|
58 | minY: 0, maxY: 100)
|
---|
59 |
|
---|
60 | @ChartHelper.LineChartTime(
|
---|
61 | "UsedCores",
|
---|
62 | Url.Action("UsedCores", "ChartData"),
|
---|
63 | title: "Cores / Used Cores",
|
---|
64 | minY: 0)
|
---|
65 |
|
---|
66 | @ChartHelper.LineChartTime(
|
---|
67 | "UsedMemory",
|
---|
68 | Url.Action("UsedMemory", "ChartData"),
|
---|
69 | title: "Memory / Used Memory (GB)",
|
---|
70 | minY: 0)
|
---|
71 |
|
---|
72 | <script>
|
---|
73 | $(document).ready(function () {
|
---|
74 | $(".date").datepicker({
|
---|
75 | dateFormat: "yy-mm-dd",
|
---|
76 | onSelect: function () { RefreshCharts(); }
|
---|
77 | });
|
---|
78 |
|
---|
79 | $("#Refresh").click(function () {
|
---|
80 | RefreshCharts();
|
---|
81 | });
|
---|
82 | });
|
---|
83 |
|
---|
84 | function RefreshCharts() {
|
---|
85 | var startDate = $('#Start').val();
|
---|
86 | var endDate = $('#End').val();
|
---|
87 |
|
---|
88 | @ChartHelper.RefreshChart("AverageCpuUtilization", Url.Action("AverageCpuUtilization", "ChartData"), "startDate", "endDate",0,100)
|
---|
89 | @ChartHelper.RefreshChart("UsedCores", Url.Action("UsedCores", "ChartData"), "startDate", "endDate",0)
|
---|
90 | @ChartHelper.RefreshChart("UsedMemory", Url.Action("UsedMemory", "ChartData"), "startDate", "endDate",0)
|
---|
91 | }
|
---|
92 |
|
---|
93 | $(document).ready(function () {
|
---|
94 | @ChartHelper.SetStreamingProperties(1000,20,10)
|
---|
95 |
|
---|
96 | @ChartHelper.CreateStreamChart("CurrentCPU", "CurrentCPUUtilization",Url.Action("CurrentCpuUtilization","ChartData"),"Current CPU Utilization","%.2f%%",100.00)
|
---|
97 | @ChartHelper.CreateStreamChart("CurrentCores", "CurrentTotalUsedCores",Url.Action("CurrentCores","ChartData"),"Current Total vs. Used Cores")
|
---|
98 | @ChartHelper.CreateStreamChart("CurrentMemory", "CurrentTotalUsedMemory",Url.Action("CurrentMemory","ChartData"),"Current Total vs. Used Memory")
|
---|
99 |
|
---|
100 | function DoUpdate() {
|
---|
101 | @ChartHelper.UpdateStreamChart("CurrentCPU","CurrentCPUUtilization", Url.Action("CurrentCpuUtilization","ChartData"),"FixedY")
|
---|
102 | @ChartHelper.UpdateStreamChart("CurrentCores","CurrentTotalUsedCores", Url.Action("CurrentCores","ChartData"))
|
---|
103 | @ChartHelper.UpdateStreamChart("CurrentMemory","CurrentTotalUsedMemory", Url.Action("CurrentMemory","ChartData"))
|
---|
104 | setTimeout(DoUpdate, refreshRate);
|
---|
105 | }
|
---|
106 |
|
---|
107 | DoUpdate();
|
---|
108 |
|
---|
109 | });
|
---|
110 | </script>
|
---|
111 | }
|
---|