提交 e1212d4c 编写于 作者: L leon.li

add sortby for method

上级 c5a351e2
......@@ -211,6 +211,16 @@ public class CacheReport {
return m_methodCounts;
}
public Long getMethodCount(String method) {
Long count = m_methodCounts.get(method);
if (count == null) {
return 0L;
} else {
return count;
}
}
public void setHited(double hited) {
m_hited = hited;
}
......@@ -250,6 +260,9 @@ public class CacheReport {
return (int) (o2.getName().getAvg() * 1000 - o1.getName().getAvg() * 1000);
} else if (m_sort.equals("name")) {
return o1.getName().getId().compareTo(o2.getName().getId());
} else if (m_sort.startsWith("method:")) {
String method = m_sort.substring(7);
return o1.getMethodCount(method).compareTo(o2.getMethodCount(method));
}
return 0;
}
......
......@@ -115,7 +115,7 @@
href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&type=${payload.type}&sort=total&queryname=${model.queryName}">Total</a></th>
<c:forEach var="method" items="${methods}">
<th><a
href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&type=${payload.type}&sort=${method}&queryname=${model.queryName}">${method}</a></th>
href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&type=${payload.type}&sort=method:${method}&queryname=${model.queryName}">${method}</a></th>
</c:forEach>
<th><a
href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&type=${payload.type}&sort=missed&queryname=${model.queryName}">Missed</a></th>
......
......@@ -109,7 +109,7 @@
href="?op=history&domain=${model.domain}&reportType=${model.reportType}${model.customDate}&date=${model.date}&ip=${model.ipAddress}&type=${payload.type}&sort=total&queryname=${model.queryName}">Total</a></th>
<c:forEach var="method" items="${methods}">
<th><a
href="?op=history&domain=${model.domain}&reportType=${model.reportType}${model.customDate}&date=${model.date}&ip=${model.ipAddress}&type=${payload.type}&sort=${method}&queryname=${model.queryName}">${method}</a></th>
href="?op=history&domain=${model.domain}&reportType=${model.reportType}${model.customDate}&date=${model.date}&ip=${model.ipAddress}&type=${payload.type}&sort=method:${method}&queryname=${model.queryName}">${method}</a></th>
</c:forEach>
<th><a
href="?op=history&domain=${model.domain}&reportType=${model.reportType}${model.customDate}&date=${model.date}&ip=${model.ipAddress}&type=${payload.type}&sort=missed&queryname=${model.queryName}">Missed</a></th>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册