Loading README.md +1 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ Sky Walking SkyWalking: Large-Scale Distributed Systems Tracing Infrastructure, also known Distributed Tracer. [](https://travis-ci.org/wu-sheng/sky-walking) [](https://coveralls.io/github/wu-sheng/sky-walking?branch=master)  [](https://codebeat.co/projects/github-com-wu-sheng-sky-walking) [](https://gitter.im/sky-walking/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Loading skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/LogData.java +3 −3 Original line number Diff line number Diff line Loading @@ -12,14 +12,14 @@ import java.util.Map; */ public class LogData { @Expose @SerializedName(value="ti") @SerializedName(value="tm") private long time; @Expose @SerializedName(value="fi") private Map<String, ?> fields; private Map<String, String> fields; LogData(long time, Map<String, ?> fields) { LogData(long time, Map<String, String> fields) { this.time = time; if(fields == null){ throw new NullPointerException(); Loading skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/SegmentsMessage.java +0 −1 Original line number Diff line number Diff line package com.a.eye.skywalking.trace; import com.a.eye.skywalking.trace.TraceId.PropagatedTraceId; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.TypeAdapter; Loading skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/Span.java +33 −11 Original line number Diff line number Diff line Loading @@ -57,8 +57,16 @@ public class Span{ * {@see https://github.com/opentracing/specification/blob/master/specification.md#set-a-span-tag} */ @Expose @SerializedName(value="ta") private final Map<String, Object> tags; @SerializedName(value="ts") private final Map<String, String> tagsWithStr; @Expose @SerializedName(value="tb") private final Map<String, Boolean> tagsWithBool; @Expose @SerializedName(value="ti") private final Map<String, Integer> tagsWithInt; /** * Log is a concept from OpenTracing spec. Loading Loading @@ -151,7 +159,9 @@ public class Span{ * Create a new/empty span. */ public Span() { tags = new HashMap<String, Object>(); tagsWithStr = new HashMap<String, String>(5); tagsWithBool = new HashMap<String, Boolean>(1); tagsWithInt = new HashMap<String, Integer>(2); logs = new LinkedList<LogData>(); } Loading Loading @@ -194,17 +204,17 @@ public class Span{ * @return this Span instance, for chaining */ public final Span setTag(String key, String value) { tags.put(key, value); tagsWithStr.put(key, value); return this; } public final Span setTag(String key, boolean value) { tags.put(key, value); tagsWithBool.put(key, value); return this; } public final Span setTag(String key, Number value) { tags.put(key, value); public final Span setTag(String key, Integer value) { tagsWithInt.put(key, value); return this; } Loading @@ -214,7 +224,11 @@ public class Span{ * @return */ public final Map<String, Object> getTags() { return Collections.unmodifiableMap(tags); Map<String, Object> tags = new HashMap<String, Object>(); tags.putAll(tagsWithStr); tags.putAll(tagsWithBool); tags.putAll(tagsWithInt); return tags; } /** Loading @@ -223,8 +237,16 @@ public class Span{ * @param key the given tag key. * @return tag value. */ public Object getTag(String key) { return tags.get(key); public String getStrTag(String key) { return tagsWithStr.get(key); } public Boolean getBoolTag(String key) { return tagsWithBool.get(key); } public Integer getIntTag(String key) { return tagsWithInt.get(key); } /** Loading @@ -250,7 +272,7 @@ public class Span{ * @return the Span, for chaining * @see Span#log(String) */ public Span log(Map<String, ?> fields) { public Span log(Map<String, String> fields) { logs.add(new LogData(System.currentTimeMillis(), fields)); return this; } Loading skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/TraceSegment.java +27 −8 Original line number Diff line number Diff line Loading @@ -89,6 +89,16 @@ public class TraceSegment { @SerializedName(value = "gt") private DistributedTraceIds relatedGlobalTraces; /** * The <code>sampled</code> is a flag, which represent, when this {@link TraceSegment} finished, it need to be send * to Collector. * * Its value depends on SamplingService. True, by default. * * This value is not serialized. */ private boolean sampled; /** * Create a trace segment, by given segmentId. * This segmentId is generated by TraceSegmentRef, AKA, from tracer/agent module. Loading @@ -107,6 +117,7 @@ public class TraceSegment { this.spans = new LinkedList<Span>(); this.relatedGlobalTraces = new DistributedTraceIds(); this.relatedGlobalTraces.append(new NewDistributedTraceId()); this.sampled = true; } /** Loading Loading @@ -183,6 +194,14 @@ public class TraceSegment { return applicationCode; } public boolean isSampled() { return sampled; } public void setSampled(boolean sampled) { this.sampled = sampled; } @Override public String toString() { return "TraceSegment{" + Loading Loading
README.md +1 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ Sky Walking SkyWalking: Large-Scale Distributed Systems Tracing Infrastructure, also known Distributed Tracer. [](https://travis-ci.org/wu-sheng/sky-walking) [](https://coveralls.io/github/wu-sheng/sky-walking?branch=master)  [](https://codebeat.co/projects/github-com-wu-sheng-sky-walking) [](https://gitter.im/sky-walking/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Loading
skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/LogData.java +3 −3 Original line number Diff line number Diff line Loading @@ -12,14 +12,14 @@ import java.util.Map; */ public class LogData { @Expose @SerializedName(value="ti") @SerializedName(value="tm") private long time; @Expose @SerializedName(value="fi") private Map<String, ?> fields; private Map<String, String> fields; LogData(long time, Map<String, ?> fields) { LogData(long time, Map<String, String> fields) { this.time = time; if(fields == null){ throw new NullPointerException(); Loading
skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/SegmentsMessage.java +0 −1 Original line number Diff line number Diff line package com.a.eye.skywalking.trace; import com.a.eye.skywalking.trace.TraceId.PropagatedTraceId; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.TypeAdapter; Loading
skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/Span.java +33 −11 Original line number Diff line number Diff line Loading @@ -57,8 +57,16 @@ public class Span{ * {@see https://github.com/opentracing/specification/blob/master/specification.md#set-a-span-tag} */ @Expose @SerializedName(value="ta") private final Map<String, Object> tags; @SerializedName(value="ts") private final Map<String, String> tagsWithStr; @Expose @SerializedName(value="tb") private final Map<String, Boolean> tagsWithBool; @Expose @SerializedName(value="ti") private final Map<String, Integer> tagsWithInt; /** * Log is a concept from OpenTracing spec. Loading Loading @@ -151,7 +159,9 @@ public class Span{ * Create a new/empty span. */ public Span() { tags = new HashMap<String, Object>(); tagsWithStr = new HashMap<String, String>(5); tagsWithBool = new HashMap<String, Boolean>(1); tagsWithInt = new HashMap<String, Integer>(2); logs = new LinkedList<LogData>(); } Loading Loading @@ -194,17 +204,17 @@ public class Span{ * @return this Span instance, for chaining */ public final Span setTag(String key, String value) { tags.put(key, value); tagsWithStr.put(key, value); return this; } public final Span setTag(String key, boolean value) { tags.put(key, value); tagsWithBool.put(key, value); return this; } public final Span setTag(String key, Number value) { tags.put(key, value); public final Span setTag(String key, Integer value) { tagsWithInt.put(key, value); return this; } Loading @@ -214,7 +224,11 @@ public class Span{ * @return */ public final Map<String, Object> getTags() { return Collections.unmodifiableMap(tags); Map<String, Object> tags = new HashMap<String, Object>(); tags.putAll(tagsWithStr); tags.putAll(tagsWithBool); tags.putAll(tagsWithInt); return tags; } /** Loading @@ -223,8 +237,16 @@ public class Span{ * @param key the given tag key. * @return tag value. */ public Object getTag(String key) { return tags.get(key); public String getStrTag(String key) { return tagsWithStr.get(key); } public Boolean getBoolTag(String key) { return tagsWithBool.get(key); } public Integer getIntTag(String key) { return tagsWithInt.get(key); } /** Loading @@ -250,7 +272,7 @@ public class Span{ * @return the Span, for chaining * @see Span#log(String) */ public Span log(Map<String, ?> fields) { public Span log(Map<String, String> fields) { logs.add(new LogData(System.currentTimeMillis(), fields)); return this; } Loading
skywalking-commons/skywalking-trace/src/main/java/com/a/eye/skywalking/trace/TraceSegment.java +27 −8 Original line number Diff line number Diff line Loading @@ -89,6 +89,16 @@ public class TraceSegment { @SerializedName(value = "gt") private DistributedTraceIds relatedGlobalTraces; /** * The <code>sampled</code> is a flag, which represent, when this {@link TraceSegment} finished, it need to be send * to Collector. * * Its value depends on SamplingService. True, by default. * * This value is not serialized. */ private boolean sampled; /** * Create a trace segment, by given segmentId. * This segmentId is generated by TraceSegmentRef, AKA, from tracer/agent module. Loading @@ -107,6 +117,7 @@ public class TraceSegment { this.spans = new LinkedList<Span>(); this.relatedGlobalTraces = new DistributedTraceIds(); this.relatedGlobalTraces.append(new NewDistributedTraceId()); this.sampled = true; } /** Loading Loading @@ -183,6 +194,14 @@ public class TraceSegment { return applicationCode; } public boolean isSampled() { return sampled; } public void setSampled(boolean sampled) { this.sampled = sampled; } @Override public String toString() { return "TraceSegment{" + Loading