Repository navigation
Expand file tree
/
Copy pathIndex.SQL.cshtml
More file actions
72 lines (72 loc) · 3.06 KB
/
Copy pathIndex.SQL.cshtml
File metadata and controls
72 lines (72 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
@using Opserver.Data.SQL
@using Opserver.Views.Shared.Guages
@inject SQLModule Sql
@{
var all = Sql.AllInstances;
}
<div class="panel panel-default">
<div class="panel-heading">@all.GetWorstStatus().IconSpan() SQL</div>
<div class="panel-body">
<div class="col-xs-4">
<partial Name="Gauges/Circle" Model="@(new CircleModel("Instance", all))" />
</div>
<div class="col-xs-4">
<partial Name="Gauges/Circle" Model="@(new CircleModel("AG", Sql.Clusters.SelectMany(c => c.AvailabilityGroups)))" />
</div>
<div class="col-xs-4">
<partial Name="Gauges/Circle" Model="@(new CircleModel("Database", all.SelectMany(i => i.Databases.SafeData(true))))" />
</div>
<table class="table table-super-condensed table-striped col-md-12">
@foreach (var c in Sql.Clusters)
{
<tbody>
<tr>
<th>@c.Name</th>
<th>CPU</th>
<th>Mem</th>
<th>DBs</th>
<th>Batches</th>
</tr>
@foreach (var i in c.Nodes)
{
<tr class="@i.RowClass()@(i.IsAllAGsPrimary ? " info" : null)">
<td>@i.IconSpan() <a href="~/sql/instance?node=@i.Name.UrlEncode()">@i.Name</a></td>
<td><img src="~/graph/sql/cpu/spark?node=@i.Name&time=@DateTime.UtcNow.ToString("yyyy-MM-dd")" width="100" height="16"/></td>
<partial Name="Partials.MemoryCell" Model="new PartialsMemoryCellModel(i)" />
<td>@Health.Description(i.Databases.SafeData(true))</td>
<td>@(i.BatchesPerSec?.ToComma())</td>
</tr>
}
</tbody>
}
<tbody>
<tr>
<th>Standalone</th>
<th>CPU</th>
<th>Mem</th>
<th>DBs</th>
<th>Batches</th>
</tr>
@foreach (var i in Sql.StandaloneInstances)
{
<tr class="@i.RowClass()">
<td>@i.IconSpan() <a href="~/sql/instance?node=@i.Name.UrlEncode()">@i.Name</a></td>
<td><img src="~/graph/sql/cpu/spark?node=@i.Name&time=@DateTime.UtcNow.ToString("yyyy-MM-dd")" width="100" height="16"/></td>
<partial Name="Partials.MemoryCell" Model="new PartialsMemoryCellModel(i)" />
<td>@Health.Description(i.Databases.SafeData(true))</td>
<td>@(i.BatchesPerSec?.ToComma())</td>
</tr>
}
</tbody>
<tfoot>
<tr class="total-row">
<td><strong>Total</strong></td>
<td></td>
<td></td>
<td>@all.Sum(i => i.Databases.Data?.Count ?? 0).ToComma()</td>
<td>@all.Sum(i => i.BatchesPerSec ?? 0).ToComma()</td>
</tr>
</tfoot>
</table>
</div>
</div>