diff --git a/src/main/java/com/nhn/hippo/web/calltree/span/SpanAligner.java b/src/main/java/com/nhn/hippo/web/calltree/span/SpanAligner.java index f2209e318..d7b54c8b9 100644 --- a/src/main/java/com/nhn/hippo/web/calltree/span/SpanAligner.java +++ b/src/main/java/com/nhn/hippo/web/calltree/span/SpanAligner.java @@ -26,8 +26,8 @@ public class SpanAligner { private static final Comparator timeComparator = new Comparator() { @Override public int compare(SpanBo o1, SpanBo o2) { - long o1Timestamp = o1.getTimestamp(); - long o2Timestamp = o2.getTimestamp(); + long o1Timestamp = o1.getStartTime(); + long o2Timestamp = o2.getStartTime(); if (o1Timestamp > o2Timestamp) { return 1; } diff --git a/src/main/java/com/nhn/hippo/web/dao/TraceDao.java b/src/main/java/com/nhn/hippo/web/dao/TraceDao.java index d47bb8555..be981e501 100644 --- a/src/main/java/com/nhn/hippo/web/dao/TraceDao.java +++ b/src/main/java/com/nhn/hippo/web/dao/TraceDao.java @@ -23,5 +23,6 @@ public interface TraceDao { List> selectSpans(Set traceIds); + @Deprecated List> selectSpansAndAnnotation(Set traceIds); } diff --git a/src/main/java/com/nhn/hippo/web/dao/hbase/HbaseTraceDao.java b/src/main/java/com/nhn/hippo/web/dao/hbase/HbaseTraceDao.java index 0d271cef9..b4608dacc 100644 --- a/src/main/java/com/nhn/hippo/web/dao/hbase/HbaseTraceDao.java +++ b/src/main/java/com/nhn/hippo/web/dao/hbase/HbaseTraceDao.java @@ -26,74 +26,74 @@ import com.profiler.common.util.BytesUtils; @Repository public class HbaseTraceDao implements TraceDao { - private final byte[] COLFAM_SPAN = HBaseTables.TRACES_CF_SPAN; + private final byte[] COLFAM_SPAN = HBaseTables.TRACES_CF_SPAN; - private final byte[] COLFAM_ANNOTATION = HBaseTables.TRACES_CF_ANNOTATION; + private final byte[] COLFAM_ANNOTATION = HBaseTables.TRACES_CF_ANNOTATION; - private Logger logger = LoggerFactory.getLogger(this.getClass()); + private Logger logger = LoggerFactory.getLogger(this.getClass()); - @Autowired - private HbaseOperations2 template2; + @Autowired + private HbaseOperations2 template2; - @Autowired - @Qualifier("spanMapper") - private RowMapper> spanMapper; + @Autowired + @Qualifier("spanMapper") + private RowMapper> spanMapper; - @Autowired - @Qualifier("spanAnnotationMapper") - private RowMapper> spanAnnotationMapper; + @Autowired + @Qualifier("spanAnnotationMapper") + private RowMapper> spanAnnotationMapper; - @Override - public List selectSpan(UUID traceId) { - byte[] uuidBytes = BytesUtils.longLongToBytes(traceId.getMostSignificantBits(), traceId.getLeastSignificantBits()); - return template2.get(HBaseTables.TRACES, uuidBytes, COLFAM_SPAN, spanMapper); - } + @Override + public List selectSpan(UUID traceId) { + byte[] uuidBytes = BytesUtils.longLongToBytes(traceId.getMostSignificantBits(), traceId.getLeastSignificantBits()); + return template2.get(HBaseTables.TRACES, uuidBytes, COLFAM_SPAN, spanMapper); + } - public List selectSpanAndAnnotation(UUID traceId) { - byte[] uuidBytes = BytesUtils.longLongToBytes(traceId.getMostSignificantBits(), traceId.getLeastSignificantBits()); - Get get = new Get(uuidBytes); - get.addFamily(COLFAM_SPAN); - get.addFamily(COLFAM_ANNOTATION); - return template2.get(HBaseTables.TRACES, get, spanAnnotationMapper); - } + public List selectSpanAndAnnotation(UUID traceId) { + byte[] uuidBytes = BytesUtils.longLongToBytes(traceId.getMostSignificantBits(), traceId.getLeastSignificantBits()); + Get get = new Get(uuidBytes); + get.addFamily(COLFAM_SPAN); + get.addFamily(COLFAM_ANNOTATION); + return template2.get(HBaseTables.TRACES, get, spanAnnotationMapper); + } - @Override - public List selectSpan(long traceIdMost, long traceIdLeast) { - byte[] uuidBytes = BytesUtils.longLongToBytes(traceIdMost, traceIdLeast); - return template2.get(HBaseTables.TRACES, uuidBytes, COLFAM_SPAN, spanMapper); - } + @Override + public List selectSpan(long traceIdMost, long traceIdLeast) { + byte[] uuidBytes = BytesUtils.longLongToBytes(traceIdMost, traceIdLeast); + return template2.get(HBaseTables.TRACES, uuidBytes, COLFAM_SPAN, spanMapper); + } - @Override - public List> selectSpans(List traceIds) { - List gets = new ArrayList(traceIds.size()); - for (UUID traceId : traceIds) { - byte[] uuidBytes = BytesUtils.longLongToBytes(traceId.getMostSignificantBits(), traceId.getLeastSignificantBits()); - Get get = new Get(uuidBytes); - get.addFamily(COLFAM_SPAN); - gets.add(get); - } - return template2.get(HBaseTables.TRACES, gets, spanMapper); - } + @Override + public List> selectSpans(List traceIds) { + List gets = new ArrayList(traceIds.size()); + for (UUID traceId : traceIds) { + byte[] uuidBytes = BytesUtils.longLongToBytes(traceId.getMostSignificantBits(), traceId.getLeastSignificantBits()); + Get get = new Get(uuidBytes); + get.addFamily(COLFAM_SPAN); + gets.add(get); + } + return template2.get(HBaseTables.TRACES, gets, spanMapper); + } - @Override - public List> selectSpans(Set traceIds) { - List gets = new ArrayList(traceIds.size()); - for (TraceId traceId : traceIds) { - Get get = new Get(traceId.getBytes()); - get.addFamily(COLFAM_SPAN); - gets.add(get); - } - return template2.get(HBaseTables.TRACES, gets, spanMapper); - } + @Override + public List> selectSpans(Set traceIds) { + List gets = new ArrayList(traceIds.size()); + for (TraceId traceId : traceIds) { + Get get = new Get(traceId.getBytes()); + get.addFamily(COLFAM_SPAN); + gets.add(get); + } + return template2.get(HBaseTables.TRACES, gets, spanMapper); + } - public List> selectSpansAndAnnotation(Set traceIds) { - List gets = new ArrayList(traceIds.size()); - for (TraceId traceId : traceIds) { - Get get = new Get(traceId.getBytes()); - get.addFamily(COLFAM_SPAN); - get.addFamily(COLFAM_ANNOTATION); - gets.add(get); - } - return template2.get(HBaseTables.TRACES, gets, spanAnnotationMapper); - } + public List> selectSpansAndAnnotation(Set traceIds) { + List gets = new ArrayList(traceIds.size()); + for (TraceId traceId : traceIds) { + Get get = new Get(traceId.getBytes()); + get.addFamily(COLFAM_SPAN); + get.addFamily(COLFAM_ANNOTATION); + gets.add(get); + } + return template2.get(HBaseTables.TRACES, gets, spanAnnotationMapper); + } } diff --git a/src/main/java/com/nhn/hippo/web/mapper/SpanMapper.java b/src/main/java/com/nhn/hippo/web/mapper/SpanMapper.java index e3e6678fb..bb4aa387f 100644 --- a/src/main/java/com/nhn/hippo/web/mapper/SpanMapper.java +++ b/src/main/java/com/nhn/hippo/web/mapper/SpanMapper.java @@ -51,8 +51,6 @@ public class SpanMapper implements RowMapper> { spanBo.setLeastTraceId(least); spanBo.setSpanID(Bytes.toLong(kv.getBuffer(), kv.getQualifierOffset())); - spanBo.setSpanID(Bytes.toLong(kv.getQualifier())); - spanBo.setTimestamp(kv.getTimestamp()); spanBo.readValue(kv.getBuffer(), kv.getValueOffset()); if (logger.isTraceEnabled()) { logger.trace("read span :{}", spanBo); diff --git a/src/main/java/com/nhn/hippo/web/service/FlowChartServiceImpl.java b/src/main/java/com/nhn/hippo/web/service/FlowChartServiceImpl.java index ef41f4221..25bbfa990 100755 --- a/src/main/java/com/nhn/hippo/web/service/FlowChartServiceImpl.java +++ b/src/main/java/com/nhn/hippo/web/service/FlowChartServiceImpl.java @@ -33,170 +33,170 @@ import com.profiler.common.hbase.HBaseTables; @Service public class FlowChartServiceImpl implements FlowChartService { - private Logger logger = LoggerFactory.getLogger(this.getClass()); + private Logger logger = LoggerFactory.getLogger(this.getClass()); - @Autowired - @Qualifier("hbaseClient") - HBaseClient client; + @Autowired + @Qualifier("hbaseClient") + HBaseClient client; - @Autowired - private TraceDao traceDao; + @Autowired + private TraceDao traceDao; - @Autowired - private RootTraceIndexDao rootTraceIndexDao; + @Autowired + private RootTraceIndexDao rootTraceIndexDao; - @Autowired - private TraceIndexDao traceIndexDao; + @Autowired + private TraceIndexDao traceIndexDao; - @Autowired - private ApplicationIndexDao applicationIndexDao; + @Autowired + private ApplicationIndexDao applicationIndexDao; - @Autowired - private ApplicationTraceIndexDao applicationTraceIndexDao; + @Autowired + private ApplicationTraceIndexDao applicationTraceIndexDao; - @Override - public List selectAllApplicationNames() { - return applicationIndexDao.selectAllApplicationNames(); - } + @Override + public List selectAllApplicationNames() { + return applicationIndexDao.selectAllApplicationNames(); + } - @Override - public String[] selectAgentIdsFromApplicationName(String applicationName) { - return applicationIndexDao.selectAgentIds(applicationName); - } + @Override + public String[] selectAgentIdsFromApplicationName(String applicationName) { + return applicationIndexDao.selectAgentIds(applicationName); + } - @Override - public Set selectTraceIdsFromTraceIndex(String[] agentIds, long from, long to) { - if (agentIds == null) { - throw new NullPointerException("agentIds"); - } + @Override + public Set selectTraceIdsFromTraceIndex(String[] agentIds, long from, long to) { + if (agentIds == null) { + throw new NullPointerException("agentIds"); + } - if (agentIds.length == 1) { - // single scan - if (logger.isTraceEnabled()) { - logger.trace("scan {}, {}, {}", new Object[] { agentIds[0], from, to }); - } - List bytes = this.traceIndexDao.scanTraceIndex(agentIds[0], from, to); - Set result = new HashSet(); - for (byte[] traceId : bytes) { - TraceId tid = new TraceId(traceId); - result.add(tid); - logger.trace("traceid:{}", tid); - } - return result; - } else { - // multi scan 가능한 동일 open htable 에서 액세스함. - List> multiScan = this.traceIndexDao.multiScanTraceIndex(agentIds, from, to); - Set result = new HashSet(); - for (List scan : multiScan) { - for (byte[] traceId : scan) { - result.add(new TraceId(traceId)); - } - } - return result; - } - } + if (agentIds.length == 1) { + // single scan + if (logger.isTraceEnabled()) { + logger.trace("scan {}, {}, {}", new Object[]{agentIds[0], from, to}); + } + List bytes = this.traceIndexDao.scanTraceIndex(agentIds[0], from, to); + Set result = new HashSet(); + for (byte[] traceId : bytes) { + TraceId tid = new TraceId(traceId); + result.add(tid); + logger.trace("traceid:{}", tid); + } + return result; + } else { + // multi scan 가능한 동일 open htable 에서 액세스함. + List> multiScan = this.traceIndexDao.multiScanTraceIndex(agentIds, from, to); + Set result = new HashSet(); + for (List scan : multiScan) { + for (byte[] traceId : scan) { + result.add(new TraceId(traceId)); + } + } + return result; + } + } - @Override - public RPCCallTree selectRPCCallTree(Set traceIds) { - final RPCCallTree tree = new RPCCallTree(); - List> traces = this.traceDao.selectSpans(traceIds); - for (List transaction : traces) { - for (SpanBo eachTransaction : transaction) { - tree.addSpan(eachTransaction); - } - } - return tree.build(); - } + @Override + public RPCCallTree selectRPCCallTree(Set traceIds) { + final RPCCallTree tree = new RPCCallTree(); + List> traces = this.traceDao.selectSpans(traceIds); + for (List transaction : traces) { + for (SpanBo eachTransaction : transaction) { + tree.addSpan(eachTransaction); + } + } + return tree.build(); + } - @Override - public ServerCallTree selectServerCallTree(Set traceIds) { - final ServerCallTree tree = new ServerCallTree(); + @Override + public ServerCallTree selectServerCallTree(Set traceIds) { + final ServerCallTree tree = new ServerCallTree(); - List> traces = this.traceDao.selectSpansAndAnnotation(traceIds); + List> traces = this.traceDao.selectSpans(traceIds); - for (List transaction : traces) { - List processed = refine(transaction); - markRecursiveCall(processed); - for (SpanBo eachTransaction : processed) { - tree.addSpan(eachTransaction); - } - } - return tree.build(); - } + for (List transaction : traces) { + List processed = refine(transaction); + markRecursiveCall(processed); + for (SpanBo eachTransaction : processed) { + tree.addSpan(eachTransaction); + } + } + return tree.build(); + } - private List refine(List list) { - SpanBo removeSpan = null; - boolean rescan = true; + private List refine(List list) { + SpanBo removeSpan = null; + boolean rescan = true; - for (int i = 0; i < list.size(); i++) { - SpanBo span = list.get(i); - String svcName = span.getServiceName(); + for (int i = 0; i < list.size(); i++) { + SpanBo span = list.get(i); + String svcName = span.getServiceName(); - if (removeSpan != null) { - if (span.getParentSpanId() == removeSpan.getSpanId()) { - logger.debug("modify span for removed span. before {}", span); + if (removeSpan != null) { + if (span.getParentSpanId() == removeSpan.getSpanId()) { + logger.debug("modify span for removed span. before {}", span); - span.setParentSpanId(removeSpan.getParentSpanId()); - span.getAnnotationBoList().addAll(removeSpan.getAnnotationBoList()); + span.setParentSpanId(removeSpan.getParentSpanId()); + span.getAnnotationBoList().addAll(removeSpan.getAnnotationBoList()); - logger.debug("modify span for removed span. after {}", span); + logger.debug("modify span for removed span. after {}", span); - removeSpan = null; - } - } + removeSpan = null; + } + } - // TODO 임시로 HTTP/1.1을 확인하게 해두었음. merge해야하는 span 확인 방법을 바꿔야함. - if ("HTTP/1.1".equals(svcName)) { - removeSpan = list.get(i); - logger.debug("Remove span. {}", removeSpan); - list.remove(i); - } + // TODO 임시로 HTTP/1.1을 확인하게 해두었음. merge해야하는 span 확인 방법을 바꿔야함. + if ("HTTP/1.1".equals(svcName)) { + removeSpan = list.get(i); + logger.debug("Remove span. {}", removeSpan); + list.remove(i); + } - if (removeSpan != null && i == list.size() - 1 && rescan) { - logger.debug("modify span not found. scan again. {}", removeSpan); - i = -1; - rescan = false; - continue; - } - } + if (removeSpan != null && i == list.size() - 1 && rescan) { + logger.debug("modify span not found. scan again. {}", removeSpan); + i = -1; + rescan = false; + continue; + } + } - return list; - } - - private void markRecursiveCall(final List list) { - for (int i = 0; i < list.size(); i++) { - SpanBo a = list.get(i); - for (int j = 0; j < list.size(); j++) { - if (i == j) - continue; - SpanBo b = list.get(j); - if (a.getServiceName().equals(b.getServiceName()) && a.getSpanId() == b.getParentSpanId()) { - a.increaseRecursiveCallCount(); - } - } - } - } + return list; + } - @Override - public Set selectTraceIdsFromApplicationTraceIndex(String applicationName, long from, long to) { - if (applicationName == null) { - throw new NullPointerException("applicationName"); - } + private void markRecursiveCall(final List list) { + for (int i = 0; i < list.size(); i++) { + SpanBo a = list.get(i); + for (int j = 0; j < list.size(); j++) { + if (i == j) + continue; + SpanBo b = list.get(j); + if (a.getServiceName().equals(b.getServiceName()) && a.getSpanId() == b.getParentSpanId()) { + a.increaseRecursiveCallCount(); + } + } + } + } + + @Override + public Set selectTraceIdsFromApplicationTraceIndex(String applicationName, long from, long to) { + if (applicationName == null) { + throw new NullPointerException("applicationName"); + } + + if (logger.isTraceEnabled()) { + logger.trace("scan {}, {}, {}", new Object[]{applicationName, from, to}); + } + + List bytes = this.applicationTraceIndexDao.scanTraceIndex(applicationName, from, to); + Set result = new HashSet(); + for (byte[] traceId : bytes) { + TraceId tid = new TraceId(traceId); + result.add(tid); + logger.trace("traceid:{}", tid); + } + return result; + } - if (logger.isTraceEnabled()) { - logger.trace("scan {}, {}, {}", new Object[] { applicationName, from, to }); - } - - List bytes = this.applicationTraceIndexDao.scanTraceIndex(applicationName, from, to); - Set result = new HashSet(); - for (byte[] traceId : bytes) { - TraceId tid = new TraceId(traceId); - result.add(tid); - logger.trace("traceid:{}", tid); - } - return result; - } - @Override public String[] selectAgentIds(String[] hosts) { List column = new ArrayList(); 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 172a75dc7..d73b6dbb6 100644 --- a/src/main/java/com/nhn/hippo/web/vo/BusinessTransaction.java +++ b/src/main/java/com/nhn/hippo/web/vo/BusinessTransaction.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; import java.util.UUID; -import com.profiler.common.bo.AnnotationBo; import com.profiler.common.bo.SpanBo; public class BusinessTransaction { @@ -19,45 +18,28 @@ public class BusinessTransaction { public BusinessTransaction(SpanBo span) { this.name = span.getName(); - List annotations = span.getAnnotationBoList(); - long begin = 0; - long end = 0; - for (AnnotationBo a : annotations) { - if (a.getKey().equals("SR") || a.getKey().equals("CS")) { - begin = a.getTimestamp(); - } - if (a.getKey().equals("SS") || a.getKey().equals("CR")) { - end = a.getTimestamp(); - } - } + long begin = span.getStartTime(); + long end = span.getEndTime(); long elapsed = end - begin; totalTime = maxTime = minTime = elapsed; - - this.traces.add(new Trace(new UUID(span.getMostTraceId(), span.getLeastTraceId()).toString(), elapsed, span.getTimestamp())); + + this.traces.add(new Trace(new UUID(span.getMostTraceId(), span.getLeastTraceId()).toString(), elapsed, span.getStartTime())); calls++; } public void add(SpanBo span) { - List annotations = span.getAnnotationBoList(); - long begin = 0; - long end = 0; - for (AnnotationBo a : annotations) { - if (a.getKey().equals("SR") || a.getKey().equals("CS")) { - begin = a.getTimestamp(); - } - if (a.getKey().equals("SS") || a.getKey().equals("CR")) { - end = a.getTimestamp(); - } - } + long begin = span.getStartTime(); + long end = span.getEndTime(); + long elapsed = end - begin; totalTime += elapsed; if (maxTime < elapsed) maxTime = elapsed; if (minTime > elapsed) minTime = elapsed; - - this.traces.add(new Trace(new UUID(span.getMostTraceId(), span.getLeastTraceId()).toString(), elapsed, span.getTimestamp())); - + + this.traces.add(new Trace(new UUID(span.getMostTraceId(), span.getLeastTraceId()).toString(), elapsed, span.getStartTime())); + 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 78bd03ed9..8409d4634 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,25 @@ package com.nhn.hippo.web.vo; public class Trace { - private final String traceId; - private final long executionTime; - private final long timestamp; + private final String traceId; + private final long executionTime; + private final long startTime; - public Trace(String traceId, long executionTime, long timestamp) { - this.traceId = traceId; - this.executionTime = executionTime; - this.timestamp = timestamp; - } + public Trace(String traceId, long executionTime, long startTime) { + this.traceId = traceId; + this.executionTime = executionTime; + this.startTime = startTime; + } - public String getTraceId() { - return traceId; - } + public String getTraceId() { + return traceId; + } - public long getExecutionTime() { - return executionTime; - } + public long getExecutionTime() { + return executionTime; + } - public long getTimestamp() { - return timestamp; - } + public long getStartTime() { + return startTime; + } } diff --git a/src/main/webapp/WEB-INF/views/selectTransaction.jsp b/src/main/webapp/WEB-INF/views/selectTransaction.jsp index 66b10a3a2..97ef29adc 100644 --- a/src/main/webapp/WEB-INF/views/selectTransaction.jsp +++ b/src/main/webapp/WEB-INF/views/selectTransaction.jsp @@ -53,139 +53,137 @@ -
+
+
+
Application Timeline
-
+
-
- - - - - - - - - - - - - -
-
${sp.serviceName} (${end - begin}ms)
-
-
-
-
- -
+
+ + + + + + + + + + + + + +
+
${sp.serviceName} (${end - begin}ms)
+
+
+
+
+ +
+
+
Application Details
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#span timeApplicationendpoint@ timeActionAction
${status.count}${sp.timestamp}${sp.serviceName}${sp.endPoint}${ano.timestamp}${ano.key}${hippo:bytesToString(ano.valueType, ano.value)}
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#span timeApplicationendpoint@ timeActionAction
${status.count}${sp.startTime}${sp.serviceName}${sp.endPoint}${ano.timestamp}${ano.key}${hippo:bytesToString(ano.valueType, ano.value)}
 
diff --git a/src/test/java/com/nhn/hippo/web/path/PathTest.java b/src/test/java/com/nhn/hippo/web/path/PathTest.java index e0447a4e0..6a984bd62 100644 --- a/src/test/java/com/nhn/hippo/web/path/PathTest.java +++ b/src/test/java/com/nhn/hippo/web/path/PathTest.java @@ -37,7 +37,7 @@ public class PathTest { public void printSpan(String msg, Span span) { // System.out.println(msg + " id:" + span.getSpanID() + " pid:" + span.getParentSpanId() + " time:" + format.format(new Date(span.getTimestamp()))); - System.out.println(msg + " id:" + span.getSpanId() + " pid:" + span.getParentSpanId() + " time:" + span.getTimestamp()); + System.out.println(msg + " id:" + span.getSpanId() + " pid:" + span.getParentSpanId() + " time:" + span.getStartTime()); } // private Span root() { // TraceID traceID = TraceID.newTraceId(); diff --git a/src/test/java/com/nhn/hippo/web/performance/TestSuite.java b/src/test/java/com/nhn/hippo/web/performance/TestSuite.java index a2feb9123..cd67ef41f 100644 --- a/src/test/java/com/nhn/hippo/web/performance/TestSuite.java +++ b/src/test/java/com/nhn/hippo/web/performance/TestSuite.java @@ -12,7 +12,7 @@ import java.io.IOException; * */ public class TestSuite { - // @Test + @Test public void insertData() throws IOException, InterruptedException { @@ -35,7 +35,6 @@ public class TestSuite { HttpGet get4 = new HttpGet("http://localhost:8080/combination.hippo"); HttpResponse execute = client.execute(get4); } - Thread.sleep(300); } } diff --git a/src/test/java/com/nhn/hippo/web/service/SpanServiceTest.java b/src/test/java/com/nhn/hippo/web/service/SpanServiceTest.java index 4777d2f06..6ea34ca3c 100644 --- a/src/test/java/com/nhn/hippo/web/service/SpanServiceTest.java +++ b/src/test/java/com/nhn/hippo/web/service/SpanServiceTest.java @@ -119,7 +119,7 @@ public class SpanServiceTest { List ano = Collections.emptyList(); long time = System.currentTimeMillis(); int andIncrement = id.getAndIncrement(); - Span span = new Span("UnitTest", time, uuid.getMostSignificantBits(), uuid.getLeastSignificantBits(), "test", "rpc" + andIncrement, andIncrement, ano, "protocol:ip:port", false); + Span span = new Span("UnitTest", uuid.getMostSignificantBits(), uuid.getLeastSignificantBits(), time, time + 5, "test", "rpc" + andIncrement, andIncrement, ano, "protocol:ip:port", false); span.setParentSpanId(-1); List annotations = new ArrayList(); annotations.add(new Annotation(0, "root ann", 0)); @@ -131,7 +131,7 @@ public class SpanServiceTest { List ano = Collections.emptyList(); long time = System.currentTimeMillis(); int andIncrement = id.getAndIncrement(); - Span sub = new Span("UnitTest", time, span.getMostTraceId(), span.getLeastTraceId(), "test", "rpc" + andIncrement, andIncrement, ano, "protocol:ip:port", false); + Span sub = new Span("UnitTest", span.getMostTraceId(), span.getLeastTraceId(), time, time + 5, "test", "rpc" + andIncrement, andIncrement, ano, "protocol:ip:port", false); sub.setParentSpanId(span.getSpanId()); List annotations = new ArrayList(); annotations.add(new Annotation(0, "sub ann" + andIncrement, 0));