crossHistoryMethod.jsp 7.4 KB
Newer Older
Y
youyong 已提交
1 2 3 4 5 6 7 8 9 10 11
<%@ 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.cross.Context" scope="request" />
<jsp:useBean id="payload"  	type="com.dianping.cat.report.page.cross.Payload" scope="request" />
<jsp:useBean id="model" type="com.dianping.cat.report.page.cross.Model" scope="request" />

<a:historyReport title="Cross Report"
	navUrlPrefix="ip=${model.ipAddress}&domain=${model.domain}">
Y
youyong 已提交
12
	<jsp:attribute name="subtitle">From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyDisplayEndDate,'yyyy-MM-dd HH:mm:ss')}</jsp:attribute>
Y
youyong 已提交
13
	<jsp:body>
14
<%@ include file="crossQuery.jsp" %>
Y
youyong 已提交
15 16
<table class="machines">
	<tr style="text-align: left">
Y
yong.you 已提交
17
		<th>机器: &nbsp;[&nbsp; <c:choose>
Y
youyong 已提交
18
				<c:when test="${model.ipAddress eq 'All'}">
Y
youyong 已提交
19
					<a href="?op=history&domain=${model.domain}&reportType=${model.reportType}&date=${model.date}&remote=${payload.remoteIp}${model.customDate}"
Y
youyong 已提交
20 21 22
								class="current">All</a>
				</c:when>
				<c:otherwise>
Y
youyong 已提交
23
					<a href="?op=history&domain=${model.domain}&reportType=${model.reportType}&date=${model.date}&remote=${payload.remoteIp}${model.customDate}">All</a>
Y
youyong 已提交
24 25 26 27 28
				</c:otherwise>
			</c:choose> &nbsp;]&nbsp; <c:forEach var="ip" items="${model.ips}">
   	  		&nbsp;[&nbsp;
   	  		<c:choose>
					<c:when test="${model.ipAddress eq ip}">
Y
youyong 已提交
29
						<a href="?op=history&domain=${model.domain}&reportType=${model.reportType}&ip=${ip}&date=${model.date}&remote=${payload.remoteIp}${model.customDate}"
Y
youyong 已提交
30 31 32
									class="current">${ip}</a>
					</c:when>
					<c:otherwise>
Y
youyong 已提交
33
						<a href="?op=history&domain=${model.domain}&reportType=${model.reportType}&ip=${ip}&date=${model.date}&remote=${payload.remoteIp}${model.customDate}">${ip}</a>
Y
youyong 已提交
34 35 36 37 38 39 40
					</c:otherwise>
				</c:choose>
   	 		&nbsp;]&nbsp;
			 </c:forEach>
		</th>
	</tr>
</table>
Y
yong.you 已提交
41
<table class='data'>
Y
youyong 已提交
42
		<tr><th style="text-align: left" colspan='8'><input type="text" name="queryname" id="queryname" size="40" value="${model.queryName}">
Y
youyong 已提交
43 44 45
		    <input style="WIDTH: 60px" value="Filter" onclick="filterByName('${model.date}','${model.domain}','${model.ipAddress}')" type="submit">
			支持多个字符串查询,例如sql|url|task,查询结果为包含任一sql、url、task的列
			</th></tr>
46 47 48 49 50 51 52 53 54 55 56 57 58 59
		<script type="text/javascript" src="/cat/js/appendHostname.js"></script>
		<script type="text/javascript">
			var buildIpHostMap = function(){
				var ipToHost = {};
				<c:forEach var="ip" items="${model.ips}">
					ipToHost["${ip}"] = "${model.ipToHostname[ip]}";
				</c:forEach>
				return ipToHost;
			};
			
			$(document).ready(function() {
				appendHostname(buildIpHostMap());
			});
		</script>
Y
youyong 已提交
60
		<script>
Y
youyong 已提交
61 62 63 64
			function filterByName(date,domain,ip){
				var queryName=$("#queryname").val();
				var serviceSort='${model.serviceSort}';
				var callSort='${model.callSort}';
Y
youyong 已提交
65 66 67 68 69 70
				var remote='${payload.remoteIp}';
				var customDate = '${model.customDate}';
				var reportType ='${model.reportType}';
				var project = '${payload.projectName}';
				window.location.href="?op=historyMethod&domain="+domain+"&project="+project+"&reportType="+reportType+"&ip="+ip+"&date="
						+date+"&queryName="+queryName+"&remote="+remote+"&serviceSort="+serviceSort+"&callSort"+callSort+customDate;
Y
youyong 已提交
71 72
			}
		</script>
Y
youyong 已提交
73 74
		<c:if test="${!empty model.methodInfo.callProjectsInfo}">
		<tr>
Y
youyong 已提交
75 76 77
			<th class="left">Type</th>
			<th class="left">RemoteIp</th>
			<th class="left">Method</th>
Y
youyong 已提交
78 79 80 81
			<th><a href="?op=historyMethod&domain=${model.domain}&reportType=${model.reportType}&date=${model.date}&ip=${model.ipAddress}&remote=${payload.remoteIp}&serviceSort=${model.serviceSort}&callSort=total&queryName=${model.queryName}${model.customDate}">Total</a></th>
			<th><a href="?op=historyMethod&domain=${model.domain}&reportType=${model.reportType}&date=${model.date}&ip=${model.ipAddress}&remote=${payload.remoteIp}&serviceSort=${model.serviceSort}&callSort=failure&queryName=${model.queryName}${model.customDate}">Failure</a></th>
			<th><a href="?op=historyMethod&domain=${model.domain}&reportType=${model.reportType}&date=${model.date}&ip=${model.ipAddress}&remote=${payload.remoteIp}&serviceSort=${model.serviceSort}&callSort=failurePercent&queryName=${model.queryName}${model.customDate}">Failure%</a></th>
			<th><a href="?op=historyMethod&domain=${model.domain}&reportType=${model.reportType}&date=${model.date}&ip=${model.ipAddress}&remote=${payload.remoteIp}&serviceSort=${model.serviceSort}&callSort=avg&queryName=${model.queryName}${model.customDate}">Avg(ms)</a></th>
Y
yong.you 已提交
82
			<th>QPS</th>
Y
youyong 已提交
83 84
		</tr>
		<c:forEach var="callInfo" items="${model.methodInfo.callProjectsInfo}" varStatus="status">
Y
yong.you 已提交
85
			<tr class="${status.index mod 2 != 0 ? 'odd' : 'even'} right">
Y
youyong 已提交
86 87 88
		         	<td class="left">${callInfo.type}</td>
					<td class="left">${callInfo.ip}</td>
					<td class="left">${callInfo.id}</td>
Y
youyong 已提交
89 90
		         	<td>${w:format(callInfo.totalCount,'#,###,###,###,##0')}</td>
		         	<td>${w:format(callInfo.failureCount,'#,###,###,###,##0')}</td>
Y
yong.you 已提交
91
		        	<td>${w:format(callInfo.failurePercent,'0.0000%')}</td>
Y
youyong 已提交
92 93 94 95 96 97 98 99 100 101
		            <td>${w:format(callInfo.avg,'0.00')}</td>
		            <td>${w:format(callInfo.tps,'0.00')}</td>
		         </tr>
		</c:forEach>
		<tr><td>&nbsp</td></tr>
		<tr><td>&nbsp</td></tr>
		</c:if>

		<c:if test="${!empty model.methodInfo.serviceProjectsInfo}">
		      <tr>
Y
youyong 已提交
102 103 104
		         <th class="left">Type</th>
				 <th class="left">RemoteIp</th>
				 <th class="left">Method</th>
Y
youyong 已提交
105 106 107 108
		         <th><a href="?op=historyMethod&domain=${model.domain}&reportType=${model.reportType}&date=${model.date}&ip=${model.ipAddress}&remote=${payload.remoteIp}&callSort=${model.callSort}&serviceSort=total&queryName=${model.queryName}${model.customDate}">Total</a></th>
		         <th><a href="?op=historyMethod&domain=${model.domain}&reportType=${model.reportType}&date=${model.date}&ip=${model.ipAddress}&remote=${payload.remoteIp}&callSort=${model.callSort}&serviceSort=failure&queryName=${model.queryName}${model.customDate}">Failure</a></th>
		         <th><a href="?op=historyMethod&domain=${model.domain}&reportType=${model.reportType}&date=${model.date}&ip=${model.ipAddress}&remote=${payload.remoteIp}&callSort=${model.callSort}&serviceSort=failurePercent&queryName=${model.queryName}${model.customDate}">Failure%</a></th>
		         <th><a href="?op=historyMethod&domain=${model.domain}&reportType=${model.reportType}&date=${model.date}&ip=${model.ipAddress}&remote=${payload.remoteIp}&callSort=${model.callSort}&serviceSort=avg&queryName=${model.queryName}${model.customDate}">Avg(ms)</a></th>
Y
yong.you 已提交
109
		         <th>QPS</th>
Y
youyong 已提交
110 111
		      </tr>
		      <c:forEach var="serviceInfo" items="${model.methodInfo.serviceProjectsInfo}" varStatus="status">
Y
yong.you 已提交
112
		         <tr class="${status.index mod 2 != 0 ? 'odd' : 'even'} right">
Y
youyong 已提交
113 114 115
		            <td class="left">${serviceInfo.type}</td>
					<td class="left">${serviceInfo.ip}</td>
					<td class="left">${serviceInfo.id}</td>
Y
youyong 已提交
116 117
		            <td>${w:format(serviceInfo.totalCount,'#,###,###,###,##0')}</td>
		            <td>${w:format(serviceInfo.failureCount,'#,###,###,###,##0')}</td>
Y
yong.you 已提交
118
		            <td>${w:format(serviceInfo.failurePercent,'0.0000%')}</td>
Y
youyong 已提交
119 120 121 122 123 124 125 126
		            <td>${w:format(serviceInfo.avg,'0.00')}</td>
		            <td>${w:format(serviceInfo.tps,'0.00')}</td>
		         </tr>
		      </c:forEach>
		      </c:if>
</table>
</jsp:body>
</a:historyReport>