stateHistory.jsp
12.7 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
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<%@ page contentType="text/html; charset=utf-8"%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="a" uri="/WEB-INF/app.tld"%>
<%@ taglib prefix="w" uri="http://www.unidal.org/web/core"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="res" uri="http://www.unidal.org/webres"%>
<jsp:useBean id="ctx" type="com.dianping.cat.report.page.state.Context" scope="request" />
<jsp:useBean id="payload" type="com.dianping.cat.report.page.state.Payload" scope="request" />
<jsp:useBean id="model" type="com.dianping.cat.report.page.state.Model" scope="request" />
<a:historyReport title="CAT State Report"
navUrlPrefix="domain=${model.domain}&ip=${model.ipAddress}&show=${payload.show}">
<jsp:attribute name="subtitle">${w:format(model.report.startTime,'yyyy-MM-dd HH:mm:ss')} to ${w:format(model.report.endTime,'yyyy-MM-dd HH:mm:ss')}</jsp:attribute>
<jsp:body>
<res:useJs value="${res.js.local['baseGraph.js']}" target="head-js" />
<table class="machines">
<tr style="text-align: left">
<th> [ <c:choose>
<c:when test="${model.ipAddress eq 'All'}">
<a href="?op=history&show=${payload.show}&reportType=${payload.reportType}&domain=${model.domain}&date=${model.date}"
class="current">All</a>
</c:when>
<c:otherwise>
<a href="?op=history&show=${payload.show}&reportType=${payload.reportType}&domain=${model.domain}&date=${model.date}">All</a>
</c:otherwise>
</c:choose> ] <c:forEach var="ip" items="${model.ips}">
[
<c:choose>
<c:when test="${model.ipAddress eq ip}">
<a href="?op=history&show=${payload.show}&reportType=${payload.reportType}&domain=${model.domain}&ip=${ip}&date=${model.date}"
class="current">${ip}</a>
</c:when>
<c:otherwise>
<a href="?op=history&show=${payload.show}&reportType=${payload.reportType}&domain=${model.domain}&ip=${ip}&date=${model.date}">${ip}</a>
</c:otherwise>
</c:choose>
]
</c:forEach>
</th>
</tr>
</table>
<table class="table table-hover table-striped table-condensed" width="100%">
<tr>
<th width="30%" colspan=2>指标</th>
<th class="right" width="20%">值</th>
<th width="50%">备注</th>
</tr>
</tr>
<tr>
<td><a href="?op=historyGraph&ip=${model.ipAddress}&reportType=${payload.reportType}&date=${model.date}&key=total"
data-status="total" class="state_graph_link">[:: show ::]</a></td>
<td>处理消息总量</td>
<td class="right">${w:format(model.state.machine.total,'#,###,###,###,##0.#')}</td>
<td>服务器接受到消息总量</td>
</tr>
<tr></tr>
<tr class="graphs">
<td colspan="4" style="display: none"><div id="total" style="display: none"></div></td>
</tr>
<tr>
<td><a href="?op=historyGraph&ip=${model.ipAddress}&reportType=${payload.reportType}&date=${model.date}&key=totalLoss"
data-status="totalLoss" class="state_graph_link">[:: show ::]</a></td>
<td>丢失消息总量</td>
<c:choose>
<c:when test="${model.state.machine.totalLoss > 0}">
<td class="right" style="color: red;">${w:format(model.state.machine.totalLoss,'#,###,###,###,##0.#')}</td>
</c:when>
<c:otherwise>
<td class="right">${w:format(model.state.machine.totalLoss,'#,###,###,###,##0.#')}</td>
</c:otherwise>
</c:choose>
<td>服务器进行encode以及analyze处理来不及而丢失消息总量</td>
</tr>
<tr></tr>
<tr class="graphs">
<td colspan="4" style="display: none"><div id="totalLoss" style="display: none"></div></td>
</tr>
<tr>
<td><a href="?op=historyGraph&ip=${model.ipAddress}&reportType=${payload.reportType}&date=${model.date}&key=avgTps"
data-status="avgTps" class="state_graph_link">[:: show ::]</a></td>
<td>每分钟平均处理数</td>
<td class="right">${w:format(model.state.machine.avgTps,'###,###,###,##0')}</td>
<td>平均每分钟处理消息量</td>
</tr>
<tr></tr>
<tr class="graphs">
<td colspan="4" style="display: none"><div id="avgTps" style="display: none"></div></td>
</tr>
<tr>
<td><a
href="?op=historyGraph&ip=${model.ipAddress}&reportType=${payload.reportType}&date=${model.date}&key=maxTps"
data-status="maxTps" class="state_graph_link">[:: show ::]</a></td>
<td>单台机器每分钟最大处理数</td>
<td class="right">${w:format(model.state.machine.maxTps,'###,###,###,##0')}</td>
<td>单台机器平均每分钟最大处理消息数目</td>
</tr>
<tr></tr>
<tr class="graphs">
<td colspan="4" style="display: none"><div id="maxTps" style="display: none"></div></td>
</tr>
<tr>
<td><a
href="?op=historyGraph&ip=${model.ipAddress}&reportType=${payload.reportType}&date=${model.date}&key=dump"
data-status="dump" class="state_graph_link">[:: show ::]</a></td>
<td>gzip压缩成功消息数量</td>
<td class="right">${w:format(model.state.machine.dump,'###,###,###,##0')}</td>
<td>将消息进行gzip压缩消息数目</td>
</tr>
<tr></tr>
<tr class="graphs">
<td colspan="4" style="display: none"><div id="dump" style="display: none"></div></td>
</tr>
<tr>
<td><a
href="?op=historyGraph&ip=${model.ipAddress}&reportType=${payload.reportType}&date=${model.date}&key=dumpLoss"
data-status="dumpLoss" class="state_graph_link">[:: show ::]</a></td>
<td>gzip来不及压缩丢失消息数量</td>
<c:choose>
<c:when test="${model.state.machine.dumpLoss > 0}">
<td class="right" style="color: red;">${w:format(model.state.machine.dumpLoss,'#,###,###,###,##0.#')}</td>
</c:when>
<c:otherwise>
<td class="right">${w:format(model.state.machine.dumpLoss,'#,###,###,###,##0.#')}</td>
</c:otherwise>
</c:choose>
<td>将消息进行gzip压缩,gzip线程太忙而丢失消息丢失数目</td>
</tr>
<tr></tr>
<tr class="graphs">
<td colspan="4" style="display: none"><div id="dumpLoss" style="display: none"></div></td>
</tr>
<tr>
<td><a
href="?op=historyGraph&ip=${model.ipAddress}&reportType=${payload.reportType}&date=${model.date}&key=pigeonTimeError"
data-status="pigeonTimeError" class="state_graph_link">[:: show ::]</a></td>
<td>两台机器时钟不准导致消息存储丢失</td>
<td class="right">${w:format(model.state.machine.pigeonTimeError,'###,###,###,##0')}</td>
<td>这个场景用于Pigeon,服务端id是由客户端产生,客户端和服务端时钟差2小时,会导致存储丢失</td>
</tr>
<tr></tr>
<tr class="graphs">
<td colspan="4" style="display: none"><div id="pigeonTimeError" style="display: none"></div></td>
</tr>
<tr>
<td><a
href="?op=historyGraph&ip=${model.ipAddress}&reportType=${payload.reportType}&date=${model.date}&key=networkTimeError"
data-status="networkTimeError" class="state_graph_link">[:: show ::]</a></td>
<td>网络传输或者客户端延迟发送导致消息丢失</td>
<td class="right">${w:format(model.state.machine.networkTimeError,'###,###,###,##0')}</td>
<td>CAT分小时处理,当一个小时过去了,默认会延迟3分钟结束当前小时,在3分钟后还接受上个小时消息,直接丢弃</td>
</tr>
<tr></tr>
<tr class="graphs">
<td colspan="4" style="display: none"><div id="networkTimeError"
style="display: none"></div></td>
</tr>
<tr>
<td><a
href="?op=historyGraph&ip=${model.ipAddress}&reportType=${payload.reportType}&date=${model.date}&key=blockTotal"
data-status="blockTotal" class="state_graph_link">[:: show ::]</a></td>
<td>存储消息块数量</td>
<td class="right">${w:format(model.state.machine.blockTotal,'###,###,###,##0')}</td>
<td>CAT是分块存储,消息块成功放入存储队列</td>
</tr>
<tr></tr>
<tr class="graphs">
<td colspan="4" style="display: none"><div id="blockTotal" style="display: none"></div></td>
</tr>
<tr>
<td><a
href="?op=historyGraph&ip=${model.ipAddress}&reportType=${payload.reportType}&date=${model.date}&key=blockLoss"
data-status="blockLoss" class="state_graph_link">[:: show ::]</a></td>
<td>存储消息块丢失数量</td>
<c:choose>
<c:when test="${model.state.machine.blockLoss > 0}"><td class="right" style="color:red;">${w:format(model.state.machine.blockLoss,'#,###,###,###,##0.#')}</td></c:when>
<c:otherwise><td class="right">${w:format(model.state.machine.blockLoss,'#,###,###,###,##0.#')}</td></c:otherwise>
</c:choose>
<td>将存储块写入磁盘的线程太忙,存储队列溢出的消息块数量</td>
</tr>
<tr></tr>
<tr class="graphs">
<td colspan="4" style="display: none"><div id="blockLoss" style="display: none"></div></td>
</tr>
<tr>
<td><a
href="?op=historyGraph&ip=${model.ipAddress}&reportType=${payload.reportType}&date=${model.date}&key=blockTime"
data-status="blockTime" class="state_graph_link">[:: show ::]</a></td>
<td>存储消息块花费时间(分钟)</td>
<td class="right">${w:format(model.state.machine.blockTime/1000/60,'###,###,###,##0')}</td>
<td>存储消息花费的CPU时间</td>
</tr>
<tr></tr>
<tr class="graphs">
<td colspan="4" style="display: none"><div id="blockTime" style="display: none"></div></td>
</tr>
<tr>
<td><a
href="?op=historyGraph&ip=${model.ipAddress}&reportType=${payload.reportType}&date=${model.date}&key=size"
data-status="size" class="state_graph_link">[:: show ::]</a></td>
<td>压缩前消息大小(GB)</td>
<td class="right">${w:format(model.state.machine.size/1024/1024/1024,'0.00#')}</td>
<td>压缩前所有存储消息的总大小</td>
</tr>
<tr></tr>
<tr class="graphs">
<td colspan="4" style="display: none"><div id="size" style="display: none"></div></td>
</tr>
<tr>
<td><a
href="?op=historyGraph&ip=${model.ipAddress}&reportType=${payload.reportType}&date=${model.date}&key=delayAvg"
data-status="delayAvg" class="state_graph_link">[:: show ::]</a></td>
<td>系统处理延迟(ms)</td>
<td class="right">${w:format(model.state.machine.delayAvg,'0.#')}</td>
<td>客户端产生消息,到服务端存储之间的时钟误差。(在机器时钟完全准确的情况下)</td>
</tr>
<tr></tr>
<tr class="graphs">
<td colspan="4" style="display: none"><div id="delayAvg" style="display: none"></div></td>
</tr>
</table>
</br>
<c:choose>
<c:when test="${payload.show == true}">
<table class="table table-hover table-striped table-condensed" width="100%">
<tr>
<td width="10%"><a href="?op=history&domain=${model.domain}&ip=${model.ipAddress}&date=${model.date}&sort=domain&show=true">处理项目列表</a></td>
<td width="10%" class="right"><a href="?op=history&domain=${model.domain}&ip=${model.ipAddress}&date=${model.date}&sort=total&show=true">处理消息总量</a></td>
<td width="10%" class="right"><a href="?op=history&domain=${model.domain}&ip=${model.ipAddress}&date=${model.date}&sort=loss&show=true">丢失消息总量</a></td>
<td width="10%" class="right"><a href="?op=history&domain=${model.domain}&ip=${model.ipAddress}&date=${model.date}&sort=size&show=true">压缩前消息大小(GB)</a></td>
<td width="10%" class="right"><a href="?op=history&domain=${model.domain}&ip=${model.ipAddress}&date=${model.date}&sort=avg&show=true">平均消息大小(KB)</a></td>
<td width="5%" class="right"><a href="?op=history&domain=${model.domain}&ip=${model.ipAddress}&date=${model.date}&sort=machine&show=true">机器总数</a></td>
<td width="45%">项目对应机器列表</td>
</tr>
<c:forEach var="item" items="${model.state.processDomains}"
varStatus="status">
<tr class="">
<c:set var="lastIndex" value="${status.index}" />
<td>${item.name}</td>
<td style="text-align: right;">${w:format(item.total,'#,###,###,###,##0.#')}</td>
<td style="text-align: right;">${w:format(item.totalLoss,'#,###,###,###,##0.#')}</td>
<td style="text-align: right;">${w:format(item.size/1024/1024/1024,'#,###,##0.000')}</td>
<td style="text-align: right;">${w:format(item.avg/1024,'#,###,##0.000')}</td>
<td style="text-align: center;">${w:size(item.ips)}</td>
<td style="white-space: normal">${item.ips}</td>
</tr>
<tr class="graphs">
<td colspan="10" style="display: none"><div id="${item.name}:total"
style="display: none"></div></td>
</tr>
<tr class="graphs">
<td colspan="10" style="display: none"><div id="${item.name}:totalLoss"
style="display: none"></div></td>
</tr>
<tr class="graphs">
<td colspan="10" style="display: none"><div id="${item.name}:size"
style="display: none"></div></td>
</tr>
<tr></tr>
</c:forEach>
<tr style="color: white;">
<td>${lastIndex+1}</td>
<td>${model.state.totalSize}</td>
</tr>
</table>
</c:when>
</c:choose>
<res:useJs value="${res.js.local['state_js']}" target="bottom-js" />
</jsp:body>
</a:historyReport>
<script type="text/javascript" src="/cat/js/appendHostname.js"></script>
<script type="text/javascript">
$(document).ready(function() {
appendHostname(${model.ipToHostnameStr});
});
</script>