-
Notifications
You must be signed in to change notification settings - Fork 10
/
clusters.ecr
154 lines (151 loc) · 3.67 KB
/
clusters.ecr
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<html>
<head>
<meta charset="UTF-8"/>
<style type="text/css">
body {
font-family: helvetica, Arial, sans-serif;
font-weight: normal;
color: black;
background: white;
}
h1 {
padding-left: 2%;
color: #FC7307;
font-weight: bold;
font-family: source code pro, consolas, courier new, serif;
margin-bottom: 10px;
}
table {
font-size: 10px;
border: 1px solid;
width: 90%;
margin-left: 2%;
margin-right: 2%;
margin-bottom: 15px;
border-collapse: collapse;
border-style: none;
}
th,td {
border: 1px solid black;
margin: 0px;
}
.clustername {
font-size: 16px;
font-weight: bold;
text-align: left;
color: #FC7307;
background: white;
padding-left: 10px;
font-family: source code pro, consolas, courier new, serif;
}
.headers {
text-align: right;
font-size: 12px;
color: #236AB9;
background: #D4E4F7;
}
.toprow {
font-weight: bold;
background: #BFD7F3;
}
.settings {
text-align: right;
}
.values {
text-align: right;
font-size: 12px;
background: #EEEEEE;
font-family: source code pro, consolas, courier new, serif;
}
.node {
padding: 3px;
}
.error {
color: red;
border: 1px solid red;
background: #FFBFBF;
padding: 1ex;
font-weight: bold;
font-size: large;
border-radius: 5px;
text-align: center;
margin: 1em;
}
</style>
</head>
<h1>Envoy Proxy</h1>
<%- @errors.each do |error| -%>
<div class="error"><%= error %></div>
<%- end -%>
<%= @server_stats %>
<%- @clusters.each do |name, cluster| -%>
<%- next if cluster.nil? -%>
<table>
<tr>
<th colspan="5" class="clustername"><%= name %></th>
</tr>
<tr class="toprow">
<%- cluster.long_settings.each do |setting, values| -%>
<th colspan="<%= values.keys.size %>">
<%= setting %>
</th>
<%- end %>
</tr>
<tr class="headers">
<%- cluster.long_settings.each do |setting, values| -%>
<%- values.keys.each do |sub| -%>
<th><%= sub %></th>
<%- end %>
<%- end %>
<%- cluster.short_settings.keys.each do |setting| -%>
<th><%= setting %></th>
<%- end %>
</tr>
<tr class="settings">
<%- cluster.long_settings.each do |setting, values| -%>
<%- values.each do |(_, value)| -%>
<td><%= value %></td>
<%- end -%>
<%- end -%>
<%- cluster.short_settings.each do |(_, value)| -%>
<td><%= value %></td>
<%- end -%>
</tr>
<tr class="toprow">
<th rowspan="2">nodes</th>
<th colspan="3">connections</th>
<th colspan="5">requests</th>
<th colspan="3">location</th>
</tr>
<tr class="headers">
<th>cx_total</th>
<th>cx_act</th>
<th>cx_conn_fail</th>
<th>rq_act</th>
<th>rq_err</th>
<th>rq_succ</th>
<th>rq_timeout</th>
<th>rq_tot</th>
<th>region</th>
<th>zone</th>
<th>sub_zone</th>
</tr>
<%- cluster.nodes.each do |node_name, node| -%>
<tr class="values">
<td class="node"><%= node_name %></td>
<td><%= node["cx_total"]? %></td>
<td><%= node["cx_active"]? %></td>
<td><%= node["cx_connect_fail"]? %></td>
<td><%= node["rq_active"]? %></td>
<td><%= node["rq_error"]? %></td>
<td><%= node["rq_success"]? %></td>
<td><%= node["rq_timeout"]? %></td>
<td><%= node["rq_total"]? %></td>
<td><%= node["region"]? %></td>
<td><%= node["zone"]? %></td>
<td><%= node["sub_zone"]? %></td>
</tr>
<%- end -%>
</table>
<%- end -%>
</html>