From b75347f48089f755f85ee89114b9556f36104ccc Mon Sep 17 00:00:00 2001 From: pranavan135 Date: Thu, 16 Jun 2016 16:33:41 +0530 Subject: [PATCH 1/8] Nano time fields and methods are added --- .../org/apache/htrace/core/MilliSpan.java | 33 +++++++++++++++---- .../java/org/apache/htrace/core/Span.java | 20 +++++++++++ 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/htrace-core4/src/main/java/org/apache/htrace/core/MilliSpan.java b/htrace-core4/src/main/java/org/apache/htrace/core/MilliSpan.java index 5dd6bdb8..57c4152a 100644 --- a/htrace-core4/src/main/java/org/apache/htrace/core/MilliSpan.java +++ b/htrace-core4/src/main/java/org/apache/htrace/core/MilliSpan.java @@ -51,7 +51,9 @@ public class MilliSpan implements Span { private static final String EMPTY_STRING = ""; private long begin; + private long beginNano; private long end; + private long endNano; private final String description; private SpanId parents[]; private final SpanId spanId; @@ -62,8 +64,8 @@ public class MilliSpan implements Span { @Override public Span child(String childDescription) { return new MilliSpan.Builder(). - begin(System.currentTimeMillis()). - end(0). + begin(System.currentTimeMillis(),System.nanoTime()). + end(0,0). description(childDescription). parents(new SpanId[] {spanId}). spanId(spanId.newChildId()). @@ -76,7 +78,9 @@ public Span child(String childDescription) { */ public static class Builder { private long begin; + private long beginNano; private long end; + private long endNano; private String description = EMPTY_STRING; private SpanId parents[] = EMPTY_PARENT_ARRAY; private SpanId spanId = SpanId.INVALID; @@ -87,13 +91,15 @@ public static class Builder { public Builder() { } - public Builder begin(long begin) { + public Builder begin(long begin, long beginNano) { this.begin = begin; + this.beginNano = beginNano; return this; } - public Builder end(long end) { + public Builder end(long end, long endNano) { this.end = end; + this.endNano = endNano; return this; } @@ -143,7 +149,9 @@ public MilliSpan build() { public MilliSpan() { this.begin = 0; + this.beginNano = 0; this.end = 0; + this.endNano = 0; this.description = EMPTY_STRING; this.parents = EMPTY_PARENT_ARRAY; this.spanId = SpanId.INVALID; @@ -155,6 +163,8 @@ public MilliSpan() { private MilliSpan(Builder builder) { this.begin = builder.begin; this.end = builder.end; + this.beginNano = builder.beginNano; + this.endNano = builder.endNano; this.description = builder.description; this.parents = builder.parents; this.spanId = builder.spanId; @@ -170,6 +180,7 @@ public synchronized void stop() { throw new IllegalStateException("Span for " + description + " has not been started"); end = System.currentTimeMillis(); + endNano = System.nanoTime(); } } @@ -287,11 +298,11 @@ public MilliSpan deserialize(JsonParser jp, DeserializationContext ctxt) Builder builder = new Builder(); JsonNode bNode = root.get("b"); if (bNode != null) { - builder.begin(bNode.asLong()); + builder.begin(bNode.asLong(),bNode.asLong()); } JsonNode eNode = root.get("e"); if (eNode != null) { - builder.end(eNode.asLong()); + builder.end(eNode.asLong(),eNode.asLong()); } JsonNode dNode = root.get("d"); if (dNode != null) { @@ -344,4 +355,14 @@ public MilliSpan deserialize(JsonParser jp, DeserializationContext ctxt) public static MilliSpan fromJson(String json) throws IOException { return JSON_READER.readValue(json); } + + @Override + public long getStartTimeNanos() { + return beginNano; + } + + @Override + public long getStopTimeNanos() { + return endNano; + } } diff --git a/htrace-core4/src/main/java/org/apache/htrace/core/Span.java b/htrace-core4/src/main/java/org/apache/htrace/core/Span.java index 43992599..9a58b9ca 100644 --- a/htrace-core4/src/main/java/org/apache/htrace/core/Span.java +++ b/htrace-core4/src/main/java/org/apache/htrace/core/Span.java @@ -48,6 +48,13 @@ public interface Span { */ long getStartTimeMillis(); + /** + * Get the span start time. + * + * @return The start time, in approximate nanoseconds since the epoch. + */ + long getStartTimeNanos(); + /** * Get the span stop time. * @@ -55,6 +62,13 @@ public interface Span { */ long getStopTimeMillis(); + /** + * Get the span stop time. + * + * @return The stop time, in approximate nanoseconds since the epoch. + */ + long getStopTimeNanos(); + /** * Return the total amount of time elapsed since start was called, if running, * or difference between stop and start @@ -176,9 +190,15 @@ public void serialize(Span span, JsonGenerator jgen, SerializerProvider provider if (span.getStartTimeMillis() != 0) { jgen.writeNumberField("b", span.getStartTimeMillis()); } + if(span.getStartTimeNanos() != 0){ + jgen.writeNumberField("k", span.getStartTimeNanos()); + } if (span.getStopTimeMillis() != 0) { jgen.writeNumberField("e", span.getStopTimeMillis()); } + if(span.getStopTimeNanos() != 0){ + jgen.writeNumberField("l",span.getStopTimeNanos()); + } if (!span.getDescription().isEmpty()) { jgen.writeStringField("d", span.getDescription()); } From 54f18371fba06f4c12c1bee8ff8f598a3919cbe5 Mon Sep 17 00:00:00 2001 From: pranavan135 Date: Thu, 16 Jun 2016 16:37:50 +0530 Subject: [PATCH 2/8] TestHBaseSpanReceiver added with default start and end nanotimes 0 --- .../apache/htrace/impl/TestHBaseSpanReceiver.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htrace-hbase/src/test/java/org/apache/htrace/impl/TestHBaseSpanReceiver.java b/htrace-hbase/src/test/java/org/apache/htrace/impl/TestHBaseSpanReceiver.java index bba19f54..d380e47e 100644 --- a/htrace-hbase/src/test/java/org/apache/htrace/impl/TestHBaseSpanReceiver.java +++ b/htrace-hbase/src/test/java/org/apache/htrace/impl/TestHBaseSpanReceiver.java @@ -193,6 +193,18 @@ public long getStopTimeMillis() { return span.getStop(); } + @Override + public long getStartTimeNanos() { + //TO DO: add nano support + return 0; + } + + @Override + public long getStopTimeNanos() { + //TO DO : add nano support + return 0; + } + @Override public SpanId getSpanId() { return new SpanId(span.getTraceId(), span.getSpanId()); From d945ed3d7beb1f7c49505b7998b94f9b75be2486 Mon Sep 17 00:00:00 2001 From: pranavan135 Date: Thu, 16 Jun 2016 21:50:24 +0530 Subject: [PATCH 3/8] Changes added to Tracer --- .../src/main/java/org/apache/htrace/core/Tracer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htrace-core4/src/main/java/org/apache/htrace/core/Tracer.java b/htrace-core4/src/main/java/org/apache/htrace/core/Tracer.java index f78e0a08..41489a7c 100644 --- a/htrace-core4/src/main/java/org/apache/htrace/core/Tracer.java +++ b/htrace-core4/src/main/java/org/apache/htrace/core/Tracer.java @@ -313,7 +313,7 @@ public String getTracerId() { private TraceScope newScopeImpl(ThreadContext context, String description) { Span span = new MilliSpan.Builder(). tracerId(tracerId). - begin(System.currentTimeMillis()). + begin(System.currentTimeMillis(),System.nanoTime()). description(description). parents(EMPTY_PARENT_ARRAY). spanId(SpanId.fromRandom()). @@ -326,7 +326,7 @@ private TraceScope newScopeImpl(ThreadContext context, String description, SpanId parentId = parentScope.getSpan().getSpanId(); Span span = new MilliSpan.Builder(). tracerId(tracerId). - begin(System.currentTimeMillis()). + begin(System.currentTimeMillis(),System.nanoTime()). description(description). parents(new SpanId[] { parentId }). spanId(parentId.newChildId()). @@ -338,7 +338,7 @@ private TraceScope newScopeImpl(ThreadContext context, String description, SpanId parentId) { Span span = new MilliSpan.Builder(). tracerId(tracerId). - begin(System.currentTimeMillis()). + begin(System.currentTimeMillis(),System.nanoTime()). description(description). parents(new SpanId[] { parentId }). spanId(parentId.newChildId()). @@ -351,7 +351,7 @@ private TraceScope newScopeImpl(ThreadContext context, String description, SpanId parentId = parentScope.getSpan().getSpanId(); Span span = new MilliSpan.Builder(). tracerId(tracerId). - begin(System.currentTimeMillis()). + begin(System.currentTimeMillis(),System.nanoTime()). description(description). parents(new SpanId[] { parentId, secondParentId }). spanId(parentId.newChildId()). From cdebb2c7ebda617caadbbe7edf78c28fb9a70511 Mon Sep 17 00:00:00 2001 From: pranavan135 Date: Thu, 16 Jun 2016 22:26:22 +0530 Subject: [PATCH 4/8] TestMilliSpan changed --- .../org/apache/htrace/core/TestMilliSpan.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htrace-core4/src/test/java/org/apache/htrace/core/TestMilliSpan.java b/htrace-core4/src/test/java/org/apache/htrace/core/TestMilliSpan.java index 7ce1fdb0..ef4f5a1c 100644 --- a/htrace-core4/src/test/java/org/apache/htrace/core/TestMilliSpan.java +++ b/htrace-core4/src/test/java/org/apache/htrace/core/TestMilliSpan.java @@ -69,8 +69,8 @@ private void compareSpans(Span expected, Span got) throws Exception { public void testJsonSerialization() throws Exception { MilliSpan span = new MilliSpan.Builder(). description("foospan"). - begin(123L). - end(456L). + begin(123L,123L). + end(456L,456L). parents(new SpanId[] { new SpanId(7L, 7L) }). tracerId("b2404.halxg.com:8080"). spanId(new SpanId(7L, 8L)). @@ -84,8 +84,8 @@ public void testJsonSerialization() throws Exception { public void testJsonSerializationWithNegativeLongValue() throws Exception { MilliSpan span = new MilliSpan.Builder(). description("foospan"). - begin(-1L). - end(-1L). + begin(-1L,-1L). + end(-1L,-1L). parents(new SpanId[] { new SpanId(-1L, -1L) }). tracerId("b2404.halxg.com:8080"). spanId(new SpanId(-1L, -2L)). @@ -100,8 +100,8 @@ public void testJsonSerializationWithRandomLongValue() throws Exception { SpanId parentId = SpanId.fromRandom(); MilliSpan span = new MilliSpan.Builder(). description("foospan"). - begin(ThreadLocalRandom.current().nextLong()). - end(ThreadLocalRandom.current().nextLong()). + begin(ThreadLocalRandom.current().nextLong(),ThreadLocalRandom.current().nextLong()). + end(ThreadLocalRandom.current().nextLong(),ThreadLocalRandom.current().nextLong()). parents(new SpanId[] { parentId }). tracerId("b2404.halxg.com:8080"). spanId(parentId.newChildId()). @@ -115,8 +115,8 @@ public void testJsonSerializationWithRandomLongValue() throws Exception { public void testJsonSerializationWithOptionalFields() throws Exception { MilliSpan.Builder builder = new MilliSpan.Builder(). description("foospan"). - begin(300). - end(400). + begin(300,300). + end(400,400). parents(new SpanId[] { }). tracerId("b2408.halxg.com:8080"). spanId(new SpanId(111111111L, 111111111L)); From 3de9c94bd13b023bf849e961a08f1df43628f994 Mon Sep 17 00:00:00 2001 From: pranavan135 Date: Thu, 16 Jun 2016 22:28:37 +0530 Subject: [PATCH 5/8] Testutil is changed --- .../src/test/java/org/apache/htrace/util/TestUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htrace-core4/src/test/java/org/apache/htrace/util/TestUtil.java b/htrace-core4/src/test/java/org/apache/htrace/util/TestUtil.java index 0869ca0b..b388459e 100644 --- a/htrace-core4/src/test/java/org/apache/htrace/util/TestUtil.java +++ b/htrace-core4/src/test/java/org/apache/htrace/util/TestUtil.java @@ -128,8 +128,8 @@ public static Span randomSpan(Random rand) { MilliSpan.Builder builder = new MilliSpan.Builder(); builder.spanId( new SpanId(nonZeroRandomLong(rand), nonZeroRandomLong(rand))); - builder.begin(positiveRandomLong(rand)); - builder.end(positiveRandomLong(rand)); + builder.begin(positiveRandomLong(rand),positiveRandomLong(rand)); + builder.end(positiveRandomLong(rand),positiveRandomLong(rand)); builder.description(randomString(rand)); builder.tracerId(randomString(rand)); int numParents = rand.nextInt(4); From ef87431f62bc1ff44004128ef71e3d91481eff2b Mon Sep 17 00:00:00 2001 From: pranavan135 Date: Thu, 16 Jun 2016 22:31:10 +0530 Subject: [PATCH 6/8] TestZipkinSpanReceiver changed --- .../java/org/apache/htrace/impl/TestZipkinSpanReceiver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htrace-zipkin/src/test/java/org/apache/htrace/impl/TestZipkinSpanReceiver.java b/htrace-zipkin/src/test/java/org/apache/htrace/impl/TestZipkinSpanReceiver.java index 0a22d68c..1d41ac5d 100644 --- a/htrace-zipkin/src/test/java/org/apache/htrace/impl/TestZipkinSpanReceiver.java +++ b/htrace-zipkin/src/test/java/org/apache/htrace/impl/TestZipkinSpanReceiver.java @@ -64,7 +64,7 @@ public void testSimpleTraces() throws IOException, InterruptedException { description("root"). spanId(new SpanId(100, 100)). tracerId("test"). - begin(System.currentTimeMillis()). + begin(System.currentTimeMillis(),System.nanoTime()). build(); TraceScope rootScope = tracer.newScope("root"); TraceScope innerOne = tracer.newScope("innerOne"); From b615a4255d8445ce2ff4997e371be7afdc337b72 Mon Sep 17 00:00:00 2001 From: pranavan135 Date: Thu, 16 Jun 2016 22:51:02 +0530 Subject: [PATCH 7/8] Test classes changed --- .../apache/htrace/zipkin/TestHTraceSpanToZipkinSpan.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htrace-zipkin/src/test/java/org/apache/htrace/zipkin/TestHTraceSpanToZipkinSpan.java b/htrace-zipkin/src/test/java/org/apache/htrace/zipkin/TestHTraceSpanToZipkinSpan.java index f166d35b..f59365bd 100644 --- a/htrace-zipkin/src/test/java/org/apache/htrace/zipkin/TestHTraceSpanToZipkinSpan.java +++ b/htrace-zipkin/src/test/java/org/apache/htrace/zipkin/TestHTraceSpanToZipkinSpan.java @@ -46,7 +46,7 @@ public void testHTraceToZipkin() throws IOException { parents(new SpanId[] { } ). spanId(new SpanId(100, 100)). tracerId("test"). - begin(System.currentTimeMillis()). + begin(System.currentTimeMillis(),System.nanoTime()). build(); Span innerOne = rootSpan.child("Some good work"); Span innerTwo = innerOne.child("Some more good work"); @@ -72,7 +72,7 @@ public void testHTraceAnnotationTimestamp() throws IOException, InterruptedExcep description(tracerId).parents(new SpanId[] { }). spanId(new SpanId(2L, 2L)). tracerId(tracerId). - begin(System.currentTimeMillis()). + begin(System.currentTimeMillis(),System.nanoTime()). build(); Thread.sleep(500); @@ -116,7 +116,7 @@ public void testHTraceDefaultPort() throws IOException { parents(new SpanId[] { new SpanId(2L, 2L) }). spanId(new SpanId(2L, 3L)). tracerId("hmaster"). - begin(System.currentTimeMillis()). + begin(System.currentTimeMillis(),System.nanoTime()). build(); com.twitter.zipkin.gen.Span zs = new HTraceToZipkinConverter(12345, (short) -1).convert(ms); for (com.twitter.zipkin.gen.Annotation annotation:zs.getAnnotations()) { @@ -128,7 +128,7 @@ public void testHTraceDefaultPort() throws IOException { parents(new SpanId[] {new SpanId(2, 2)}). spanId(new SpanId(2, 3)). tracerId("HregIonServer"). - begin(System.currentTimeMillis()). + begin(System.currentTimeMillis(),System.nanoTime()). build(); zs = new HTraceToZipkinConverter(12345, (short) -1).convert(ms); for (com.twitter.zipkin.gen.Annotation annotation:zs.getAnnotations()) { From aab5f35a322145a84bc990dc3c26be3f6682875e Mon Sep 17 00:00:00 2001 From: pranavan135 Date: Sat, 18 Jun 2016 09:19:10 +0530 Subject: [PATCH 8/8] MilliSpan API methods are preserved --- .../java/org/apache/htrace/core/MilliSpan.java | 10 ++++++++++ .../org/apache/htrace/core/TestMilliSpan.java | 16 ++++++++-------- .../java/org/apache/htrace/util/TestUtil.java | 4 ++-- .../htrace/impl/TestZipkinSpanReceiver.java | 2 +- .../zipkin/TestHTraceSpanToZipkinSpan.java | 8 ++++---- 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/htrace-core4/src/main/java/org/apache/htrace/core/MilliSpan.java b/htrace-core4/src/main/java/org/apache/htrace/core/MilliSpan.java index 57c4152a..04f5f27d 100644 --- a/htrace-core4/src/main/java/org/apache/htrace/core/MilliSpan.java +++ b/htrace-core4/src/main/java/org/apache/htrace/core/MilliSpan.java @@ -91,12 +91,22 @@ public static class Builder { public Builder() { } + public Builder begin(long begin){ + this.begin = begin; + return this; + } + public Builder begin(long begin, long beginNano) { this.begin = begin; this.beginNano = beginNano; return this; } + public Builder end(long end){ + this.end = end; + return this; + } + public Builder end(long end, long endNano) { this.end = end; this.endNano = endNano; diff --git a/htrace-core4/src/test/java/org/apache/htrace/core/TestMilliSpan.java b/htrace-core4/src/test/java/org/apache/htrace/core/TestMilliSpan.java index ef4f5a1c..7ce1fdb0 100644 --- a/htrace-core4/src/test/java/org/apache/htrace/core/TestMilliSpan.java +++ b/htrace-core4/src/test/java/org/apache/htrace/core/TestMilliSpan.java @@ -69,8 +69,8 @@ private void compareSpans(Span expected, Span got) throws Exception { public void testJsonSerialization() throws Exception { MilliSpan span = new MilliSpan.Builder(). description("foospan"). - begin(123L,123L). - end(456L,456L). + begin(123L). + end(456L). parents(new SpanId[] { new SpanId(7L, 7L) }). tracerId("b2404.halxg.com:8080"). spanId(new SpanId(7L, 8L)). @@ -84,8 +84,8 @@ public void testJsonSerialization() throws Exception { public void testJsonSerializationWithNegativeLongValue() throws Exception { MilliSpan span = new MilliSpan.Builder(). description("foospan"). - begin(-1L,-1L). - end(-1L,-1L). + begin(-1L). + end(-1L). parents(new SpanId[] { new SpanId(-1L, -1L) }). tracerId("b2404.halxg.com:8080"). spanId(new SpanId(-1L, -2L)). @@ -100,8 +100,8 @@ public void testJsonSerializationWithRandomLongValue() throws Exception { SpanId parentId = SpanId.fromRandom(); MilliSpan span = new MilliSpan.Builder(). description("foospan"). - begin(ThreadLocalRandom.current().nextLong(),ThreadLocalRandom.current().nextLong()). - end(ThreadLocalRandom.current().nextLong(),ThreadLocalRandom.current().nextLong()). + begin(ThreadLocalRandom.current().nextLong()). + end(ThreadLocalRandom.current().nextLong()). parents(new SpanId[] { parentId }). tracerId("b2404.halxg.com:8080"). spanId(parentId.newChildId()). @@ -115,8 +115,8 @@ public void testJsonSerializationWithRandomLongValue() throws Exception { public void testJsonSerializationWithOptionalFields() throws Exception { MilliSpan.Builder builder = new MilliSpan.Builder(). description("foospan"). - begin(300,300). - end(400,400). + begin(300). + end(400). parents(new SpanId[] { }). tracerId("b2408.halxg.com:8080"). spanId(new SpanId(111111111L, 111111111L)); diff --git a/htrace-core4/src/test/java/org/apache/htrace/util/TestUtil.java b/htrace-core4/src/test/java/org/apache/htrace/util/TestUtil.java index b388459e..0869ca0b 100644 --- a/htrace-core4/src/test/java/org/apache/htrace/util/TestUtil.java +++ b/htrace-core4/src/test/java/org/apache/htrace/util/TestUtil.java @@ -128,8 +128,8 @@ public static Span randomSpan(Random rand) { MilliSpan.Builder builder = new MilliSpan.Builder(); builder.spanId( new SpanId(nonZeroRandomLong(rand), nonZeroRandomLong(rand))); - builder.begin(positiveRandomLong(rand),positiveRandomLong(rand)); - builder.end(positiveRandomLong(rand),positiveRandomLong(rand)); + builder.begin(positiveRandomLong(rand)); + builder.end(positiveRandomLong(rand)); builder.description(randomString(rand)); builder.tracerId(randomString(rand)); int numParents = rand.nextInt(4); diff --git a/htrace-zipkin/src/test/java/org/apache/htrace/impl/TestZipkinSpanReceiver.java b/htrace-zipkin/src/test/java/org/apache/htrace/impl/TestZipkinSpanReceiver.java index 1d41ac5d..0a22d68c 100644 --- a/htrace-zipkin/src/test/java/org/apache/htrace/impl/TestZipkinSpanReceiver.java +++ b/htrace-zipkin/src/test/java/org/apache/htrace/impl/TestZipkinSpanReceiver.java @@ -64,7 +64,7 @@ public void testSimpleTraces() throws IOException, InterruptedException { description("root"). spanId(new SpanId(100, 100)). tracerId("test"). - begin(System.currentTimeMillis(),System.nanoTime()). + begin(System.currentTimeMillis()). build(); TraceScope rootScope = tracer.newScope("root"); TraceScope innerOne = tracer.newScope("innerOne"); diff --git a/htrace-zipkin/src/test/java/org/apache/htrace/zipkin/TestHTraceSpanToZipkinSpan.java b/htrace-zipkin/src/test/java/org/apache/htrace/zipkin/TestHTraceSpanToZipkinSpan.java index f59365bd..f166d35b 100644 --- a/htrace-zipkin/src/test/java/org/apache/htrace/zipkin/TestHTraceSpanToZipkinSpan.java +++ b/htrace-zipkin/src/test/java/org/apache/htrace/zipkin/TestHTraceSpanToZipkinSpan.java @@ -46,7 +46,7 @@ public void testHTraceToZipkin() throws IOException { parents(new SpanId[] { } ). spanId(new SpanId(100, 100)). tracerId("test"). - begin(System.currentTimeMillis(),System.nanoTime()). + begin(System.currentTimeMillis()). build(); Span innerOne = rootSpan.child("Some good work"); Span innerTwo = innerOne.child("Some more good work"); @@ -72,7 +72,7 @@ public void testHTraceAnnotationTimestamp() throws IOException, InterruptedExcep description(tracerId).parents(new SpanId[] { }). spanId(new SpanId(2L, 2L)). tracerId(tracerId). - begin(System.currentTimeMillis(),System.nanoTime()). + begin(System.currentTimeMillis()). build(); Thread.sleep(500); @@ -116,7 +116,7 @@ public void testHTraceDefaultPort() throws IOException { parents(new SpanId[] { new SpanId(2L, 2L) }). spanId(new SpanId(2L, 3L)). tracerId("hmaster"). - begin(System.currentTimeMillis(),System.nanoTime()). + begin(System.currentTimeMillis()). build(); com.twitter.zipkin.gen.Span zs = new HTraceToZipkinConverter(12345, (short) -1).convert(ms); for (com.twitter.zipkin.gen.Annotation annotation:zs.getAnnotations()) { @@ -128,7 +128,7 @@ public void testHTraceDefaultPort() throws IOException { parents(new SpanId[] {new SpanId(2, 2)}). spanId(new SpanId(2, 3)). tracerId("HregIonServer"). - begin(System.currentTimeMillis(),System.nanoTime()). + begin(System.currentTimeMillis()). build(); zs = new HTraceToZipkinConverter(12345, (short) -1).convert(ms); for (com.twitter.zipkin.gen.Annotation annotation:zs.getAnnotations()) {