From 232f757fc48a156279b140bb49eea4d5343ae661 Mon Sep 17 00:00:00 2001 From: youyong Date: Thu, 16 Aug 2012 22:22:21 +0800 Subject: [PATCH] modify the cat history bug --- .../cat/report/page/AbstractReportPayload.java | 11 ++++++++--- cat-home/src/main/webapp/css/body.css | 4 ++++ .../src/main/webapp/jsp/report/crossHistoryHost.jsp | 2 +- .../src/main/webapp/jsp/report/crossHistoryMethod.jsp | 2 +- .../main/webapp/jsp/report/crossHistoryProject.jsp | 2 +- .../src/main/webapp/jsp/report/eventHistoryReport.jsp | 2 +- .../main/webapp/jsp/report/heartbeatHistoryGraph.jsp | 2 +- .../main/webapp/jsp/report/matrixHistoryReport.jsp | 2 +- .../main/webapp/jsp/report/problemHistoryReport.jsp | 2 +- .../webapp/jsp/report/transactionHistoryReport.jsp | 2 +- .../java/com/dianping/cat/demo/TestSendMessage.java | 6 +++--- .../cat/report/page/transaction/PayloadTest.java | 2 +- 12 files changed, 24 insertions(+), 15 deletions(-) diff --git a/cat-home/src/main/java/com/dianping/cat/report/page/AbstractReportPayload.java b/cat-home/src/main/java/com/dianping/cat/report/page/AbstractReportPayload.java index 11731961b..1d610e77d 100755 --- a/cat-home/src/main/java/com/dianping/cat/report/page/AbstractReportPayload.java +++ b/cat-home/src/main/java/com/dianping/cat/report/page/AbstractReportPayload.java @@ -148,10 +148,15 @@ public abstract class AbstractReportPayload implements ActionP } else { temp = m_date + (ONE_HOUR * 24); } - cal.setTimeInMillis(temp -1000); + cal.setTimeInMillis(temp); return cal.getTime(); } - + + public Date getHistoryDisplayEndDate() { + Date date = getHistoryEndDate(); + return new Date(date.getTime() - 1000); + } + public Date getHistoryStartDate() { if (m_customStart != null) { try { @@ -161,7 +166,7 @@ public abstract class AbstractReportPayload implements ActionP } return new Date(m_date); } - + public String getIpAddress() { return m_ipAddress; } diff --git a/cat-home/src/main/webapp/css/body.css b/cat-home/src/main/webapp/css/body.css index e76cf3cb6..5fb3e0207 100755 --- a/cat-home/src/main/webapp/css/body.css +++ b/cat-home/src/main/webapp/css/body.css @@ -125,6 +125,10 @@ a.long-sql { background-color: #6699CC; } +a.long-service { + background-color: #7799FF; +} + a.url { background-color: #cc0000; } diff --git a/cat-home/src/main/webapp/jsp/report/crossHistoryHost.jsp b/cat-home/src/main/webapp/jsp/report/crossHistoryHost.jsp index 3293f610a..5cbae293b 100644 --- a/cat-home/src/main/webapp/jsp/report/crossHistoryHost.jsp +++ b/cat-home/src/main/webapp/jsp/report/crossHistoryHost.jsp @@ -10,7 +10,7 @@ - From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyEndDate,'yyyy-MM-dd HH:mm:ss')} + From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyDisplayEndDate,'yyyy-MM-dd HH:mm:ss')} diff --git a/cat-home/src/main/webapp/jsp/report/crossHistoryMethod.jsp b/cat-home/src/main/webapp/jsp/report/crossHistoryMethod.jsp index ff9343dd8..f717334c7 100644 --- a/cat-home/src/main/webapp/jsp/report/crossHistoryMethod.jsp +++ b/cat-home/src/main/webapp/jsp/report/crossHistoryMethod.jsp @@ -10,7 +10,7 @@ - From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyEndDate,'yyyy-MM-dd HH:mm:ss')} + From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyDisplayEndDate,'yyyy-MM-dd HH:mm:ss')} diff --git a/cat-home/src/main/webapp/jsp/report/crossHistoryProject.jsp b/cat-home/src/main/webapp/jsp/report/crossHistoryProject.jsp index 3eb8ecde4..fa638b119 100644 --- a/cat-home/src/main/webapp/jsp/report/crossHistoryProject.jsp +++ b/cat-home/src/main/webapp/jsp/report/crossHistoryProject.jsp @@ -10,7 +10,7 @@ - From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyEndDate,'yyyy-MM-dd HH:mm:ss')} + From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyDisplayEndDate,'yyyy-MM-dd HH:mm:ss')} diff --git a/cat-home/src/main/webapp/jsp/report/eventHistoryReport.jsp b/cat-home/src/main/webapp/jsp/report/eventHistoryReport.jsp index 6728db5e4..d56390583 100644 --- a/cat-home/src/main/webapp/jsp/report/eventHistoryReport.jsp +++ b/cat-home/src/main/webapp/jsp/report/eventHistoryReport.jsp @@ -8,7 +8,7 @@ - From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyEndDate,'yyyy-MM-dd HH:mm:ss')} + From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyDisplayEndDate,'yyyy-MM-dd HH:mm:ss')} diff --git a/cat-home/src/main/webapp/jsp/report/heartbeatHistoryGraph.jsp b/cat-home/src/main/webapp/jsp/report/heartbeatHistoryGraph.jsp index 6a9183adf..6d13f5ad3 100644 --- a/cat-home/src/main/webapp/jsp/report/heartbeatHistoryGraph.jsp +++ b/cat-home/src/main/webapp/jsp/report/heartbeatHistoryGraph.jsp @@ -8,7 +8,7 @@ - From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyEndDate,'yyyy-MM-dd HH:mm:ss')} + From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyDisplayEndDate,'yyyy-MM-dd HH:mm:ss')} diff --git a/cat-home/src/main/webapp/jsp/report/matrixHistoryReport.jsp b/cat-home/src/main/webapp/jsp/report/matrixHistoryReport.jsp index e6c23c07c..9f49adff2 100644 --- a/cat-home/src/main/webapp/jsp/report/matrixHistoryReport.jsp +++ b/cat-home/src/main/webapp/jsp/report/matrixHistoryReport.jsp @@ -8,7 +8,7 @@ - From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyEndDate,'yyyy-MM-dd HH:mm:ss')} + From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyDisplayEndDate,'yyyy-MM-dd HH:mm:ss')}
diff --git a/cat-home/src/main/webapp/jsp/report/problemHistoryReport.jsp b/cat-home/src/main/webapp/jsp/report/problemHistoryReport.jsp index e8104244b..152c40e54 100644 --- a/cat-home/src/main/webapp/jsp/report/problemHistoryReport.jsp +++ b/cat-home/src/main/webapp/jsp/report/problemHistoryReport.jsp @@ -9,7 +9,7 @@ - From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyEndDate,'yyyy-MM-dd HH:mm:ss')} + From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyDisplayEndDate,'yyyy-MM-dd HH:mm:ss')} diff --git a/cat-home/src/main/webapp/jsp/report/transactionHistoryReport.jsp b/cat-home/src/main/webapp/jsp/report/transactionHistoryReport.jsp index 9926907b8..eed20a9ff 100644 --- a/cat-home/src/main/webapp/jsp/report/transactionHistoryReport.jsp +++ b/cat-home/src/main/webapp/jsp/report/transactionHistoryReport.jsp @@ -8,7 +8,7 @@ - From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyEndDate,'yyyy-MM-dd HH:mm:ss')} + From ${w:format(payload.historyStartDate,'yyyy-MM-dd HH:mm:ss')} to ${w:format(payload.historyDisplayEndDate,'yyyy-MM-dd HH:mm:ss')} diff --git a/cat-home/src/test/java/com/dianping/cat/demo/TestSendMessage.java b/cat-home/src/test/java/com/dianping/cat/demo/TestSendMessage.java index c700377be..985031161 100644 --- a/cat-home/src/test/java/com/dianping/cat/demo/TestSendMessage.java +++ b/cat-home/src/test/java/com/dianping/cat/demo/TestSendMessage.java @@ -65,7 +65,7 @@ public class TestSendMessage { public void sendPigeonServerTransaction() throws Exception { for (int i = 0; i < 100; i++) { Transaction t = Cat.getProducer().newTransaction("PigeonService", "Method6"); - Cat.getProducer().newEvent("PigeonCall.client", "192.168.7.77"); + Cat.getProducer().newEvent("PigeonService.client", "192.168.7.77"); t.addData("key and value"); Thread.sleep(1); @@ -73,7 +73,7 @@ public class TestSendMessage { } for (int i = 0; i < 200; i++) { Transaction t = Cat.getProducer().newTransaction("PigeonService", "Method8"); - Cat.getProducer().newEvent("PigeonCall.client", "192.168.7.20"); + Cat.getProducer().newEvent("PigeonService.client", "192.168.7.20"); t.addData("key and value"); Thread.sleep(1); @@ -82,7 +82,7 @@ public class TestSendMessage { for (int i = 0; i < 300; i++) { Transaction t = Cat.getProducer().newTransaction("PigeonService", "Method5"); - Cat.getProducer().newEvent("PigeonCall.client", "192.168.7.231"); + Cat.getProducer().newEvent("PigeonService.client", "192.168.7.231"); t.addData("key and value"); Thread.sleep(1); diff --git a/cat-home/src/test/java/com/dianping/cat/report/page/transaction/PayloadTest.java b/cat-home/src/test/java/com/dianping/cat/report/page/transaction/PayloadTest.java index 904f0daeb..ba236a198 100755 --- a/cat-home/src/test/java/com/dianping/cat/report/page/transaction/PayloadTest.java +++ b/cat-home/src/test/java/com/dianping/cat/report/page/transaction/PayloadTest.java @@ -200,6 +200,6 @@ public class PayloadTest { } private Date adjustEndDate(Date date){ - return new Date(date.getTime()+1000); + return new Date(date.getTime()); } } -- GitLab