From 877361955657f3f082bcfa418e07bf663034f704 Mon Sep 17 00:00:00 2001 From: Chisu Yu Date: Thu, 27 Dec 2012 09:37:36 +0000 Subject: [PATCH] =?UTF-8?q?[=EC=9C=A0=EC=B9=98=EC=88=98]=20[NOBTS]=20add?= =?UTF-8?q?=20exception=20property=20to=20span?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-web/trunk@1068 84d0f5b1-2673-498c-a247-62c4ff18d310 --- .../nhn/hippo/web/vo/BusinessTransaction.java | 4 +- src/main/java/com/nhn/hippo/web/vo/Trace.java | 41 +++++++++++-------- src/main/resources/hbase.properties | 4 +- src/main/webapp/WEB-INF/views/flowserver.jsp | 3 +- src/main/webapp/common/js/hippo/hippo.js | 13 +++++- 5 files changed, 41 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/nhn/hippo/web/vo/BusinessTransaction.java b/src/main/java/com/nhn/hippo/web/vo/BusinessTransaction.java index 1c78a99bc..b80259ecf 100644 --- a/src/main/java/com/nhn/hippo/web/vo/BusinessTransaction.java +++ b/src/main/java/com/nhn/hippo/web/vo/BusinessTransaction.java @@ -23,7 +23,7 @@ public class BusinessTransaction { long end = begin + elapsed; totalTime = maxTime = minTime = elapsed; - this.traces.add(new Trace(new UUID(span.getMostTraceId(), span.getLeastTraceId()).toString(), elapsed, span.getStartTime())); + this.traces.add(new Trace(new UUID(span.getMostTraceId(), span.getLeastTraceId()).toString(), elapsed, span.getStartTime(), span.isException())); calls++; } @@ -38,7 +38,7 @@ public class BusinessTransaction { if (minTime > elapsed) minTime = elapsed; - this.traces.add(new Trace(new UUID(span.getMostTraceId(), span.getLeastTraceId()).toString(), elapsed, span.getStartTime())); + this.traces.add(new Trace(new UUID(span.getMostTraceId(), span.getLeastTraceId()).toString(), elapsed, span.getStartTime(), span.isException())); if (span.getParentSpanId() == -1) { calls++; diff --git a/src/main/java/com/nhn/hippo/web/vo/Trace.java b/src/main/java/com/nhn/hippo/web/vo/Trace.java index 8409d4634..b2ae30ef0 100644 --- a/src/main/java/com/nhn/hippo/web/vo/Trace.java +++ b/src/main/java/com/nhn/hippo/web/vo/Trace.java @@ -2,25 +2,32 @@ package com.nhn.hippo.web.vo; public class Trace { - private final String traceId; - private final long executionTime; - private final long startTime; + private final String traceId; + private final long executionTime; + private final long startTime; - public Trace(String traceId, long executionTime, long startTime) { - this.traceId = traceId; - this.executionTime = executionTime; - this.startTime = startTime; - } + private final boolean exception; - public String getTraceId() { - return traceId; - } + public Trace(String traceId, long executionTime, long startTime, boolean exception) { + this.traceId = traceId; + this.executionTime = executionTime; + this.startTime = startTime; + this.exception = exception; + } - public long getExecutionTime() { - return executionTime; - } + public String getTraceId() { + return traceId; + } - public long getStartTime() { - return startTime; - } + public long getExecutionTime() { + return executionTime; + } + + public long getStartTime() { + return startTime; + } + + public boolean isException() { + return exception; + } } diff --git a/src/main/resources/hbase.properties b/src/main/resources/hbase.properties index 28d5cbb7f..bfe90446c 100644 --- a/src/main/resources/hbase.properties +++ b/src/main/resources/hbase.properties @@ -1,8 +1,8 @@ -#hbase.client.host=localhost +hbase.client.host=localhost #hbase.client.host=10.101.17.108 #dev-hippo002.ncl -hbase.client.host=10.101.17.108 +#hbase.client.host=10.101.17.108 #3대 짜리 #hbase.client.host=10.25.131.38 diff --git a/src/main/webapp/WEB-INF/views/flowserver.jsp b/src/main/webapp/WEB-INF/views/flowserver.jsp index a50aaa538..45aed59a9 100644 --- a/src/main/webapp/WEB-INF/views/flowserver.jsp +++ b/src/main/webapp/WEB-INF/views/flowserver.jsp @@ -56,7 +56,8 @@ "traceId" : "${trace.traceId}", "timestamp" : ${trace.startTime}, "executionTime" : ${trace.executionTime}, - "name" : "${t.rpc}" + "name" : "${t.rpc}", + "exception" : ${trace.exception} } , , diff --git a/src/main/webapp/common/js/hippo/hippo.js b/src/main/webapp/common/js/hippo/hippo.js index f9a675aec..114fc2923 100644 --- a/src/main/webapp/common/js/hippo/hippo.js +++ b/src/main/webapp/common/js/hippo/hippo.js @@ -425,10 +425,19 @@ function drawScatter(data, targetId) { .data(data) .enter().append("circle") .attr("class", "dot") - .attr("r", 3) + .attr("r", 2.5) .attr("cx", function(d) { return x(d.timestamp); }) .attr("cy", function(d) { return y(d.executionTime); }) - .style("fill", function(d) { return color(d.name); }) + .style("fill", function(d) { + if (d.exception) { + return "#d62728"; // red + //} else if (d.executionTime > 500) { + // return "#ff7f0e"; // orange + } else { + return "#2ca02c"; // green + } + //return color(d.name); + }) .on("click", function(d) { openTrace(d.traceId); }); /*