diff --git a/README.md b/README.md index 97c32bb00b..8e3bd82005 100644 --- a/README.md +++ b/README.md @@ -19,16 +19,6 @@ Sky Walking | [中文](https://github.com/wu-sheng/sky-walking/wiki/sky-walking- * High performance streaming analysis. * The UI released on [wu-sheng/sky-walking-ui](https://github.com/wu-sheng/sky-walking-ui) -___ - - -OneAPM Open Source Achievement Award - - -In October 2016, Sky Walking won `OneAPM Open Source Achievement Award`. The award appreciates sky walking for its "*contribution to popularization of APM technology*".


-Thanks all users of sky walking project. - -___ # Contributors _In chronological order_ diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextCarrier.java b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextCarrier.java index fad0ab7260..0d44d305e1 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextCarrier.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextCarrier.java @@ -1,7 +1,6 @@ package org.skywalking.apm.agent.core.context; import java.io.Serializable; -import java.util.LinkedList; import java.util.List; import org.skywalking.apm.agent.core.context.ids.DistributedTraceId; import org.skywalking.apm.agent.core.context.ids.PropagatedTraceId; @@ -32,7 +31,7 @@ public class ContextCarrier implements Serializable { /** * {@link DistributedTraceId} */ - private List distributedTraceIds; + private DistributedTraceId primaryDistributedTraceId; /** * Serialize this {@link ContextCarrier} to a {@link String}, @@ -48,7 +47,7 @@ public class ContextCarrier implements Serializable { this.getApplicationInstanceId() + "", this.getPeerHost(), this.getEntryOperationName(), - this.serializeDistributedTraceIds()); + this.serializeDistributedTraceId()); } else { return ""; } @@ -69,7 +68,7 @@ public class ContextCarrier implements Serializable { this.applicationInstanceId = Integer.parseInt(parts[2]); this.peerHost = parts[3]; this.entryOperationName = parts[4]; - this.distributedTraceIds = deserializeDistributedTraceIds(parts[5]); + this.primaryDistributedTraceId = new PropagatedTraceId(parts[5]); } catch (NumberFormatException e) { } @@ -89,7 +88,7 @@ public class ContextCarrier implements Serializable { && applicationInstanceId != DictionaryUtil.nullValue() && !StringUtil.isEmpty(peerHost) && !StringUtil.isEmpty(entryOperationName) - && distributedTraceIds != null; + && primaryDistributedTraceId != null; } public String getEntryOperationName() { @@ -140,51 +139,15 @@ public class ContextCarrier implements Serializable { this.peerHost = peerId + ""; } - public List getDistributedTraceIds() { - return distributedTraceIds; + public DistributedTraceId getDistributedTraceId() { + return primaryDistributedTraceId; } public void setDistributedTraceIds(List distributedTraceIds) { - this.distributedTraceIds = distributedTraceIds; + this.primaryDistributedTraceId = distributedTraceIds.get(0); } - /** - * Serialize {@link #distributedTraceIds} to a string, with ',' split. - * - * @return string, represents all {@link DistributedTraceId} - */ - private String serializeDistributedTraceIds() { - StringBuilder traceIdString = new StringBuilder(); - if (distributedTraceIds != null) { - boolean first = true; - for (DistributedTraceId distributedTraceId : distributedTraceIds) { - if (first) { - first = false; - } else { - traceIdString.append(","); - } - traceIdString.append(distributedTraceId.get()); - } - } - return traceIdString.toString(); + private String serializeDistributedTraceId() { + return primaryDistributedTraceId.toString(); } - - /** - * Deserialize {@link #distributedTraceIds} from a text, whith - * - * @param text - * @return - */ - private List deserializeDistributedTraceIds(String text) { - if (StringUtil.isEmpty(text)) { - return null; - } - String[] propagationTraceIdValues = text.split(","); - List traceIds = new LinkedList(); - for (String propagationTraceIdValue : propagationTraceIdValues) { - traceIds.add(new PropagatedTraceId(propagationTraceIdValue)); - } - return traceIds; - } - } diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextSnapshot.java b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextSnapshot.java index 755a2275d8..85dda1eb21 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextSnapshot.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextSnapshot.java @@ -23,17 +23,17 @@ public class ContextSnapshot { /** * {@link DistributedTraceId} */ - private List distributedTraceIds; + private DistributedTraceId primaryDistributedTraceId; ContextSnapshot(String traceSegmentId, int spanId, List distributedTraceIds) { this.traceSegmentId = traceSegmentId; this.spanId = spanId; - this.distributedTraceIds = distributedTraceIds; + this.primaryDistributedTraceId = distributedTraceIds.get(0); } - public List getDistributedTraceIds() { - return distributedTraceIds; + public DistributedTraceId getDistributedTraceId() { + return primaryDistributedTraceId; } public String getTraceSegmentId() { @@ -47,7 +47,6 @@ public class ContextSnapshot { public boolean isValid() { return traceSegmentId != null && spanId > -1 - && distributedTraceIds != null - && distributedTraceIds.size() > 0; + && primaryDistributedTraceId != null; } } diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/TracingContext.java b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/TracingContext.java index 15e41c2a85..7dad94d34d 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/TracingContext.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/TracingContext.java @@ -121,7 +121,7 @@ public class TracingContext implements AbstractTracerContext { @Override public void extract(ContextCarrier carrier) { this.segment.ref(new TraceSegmentRef(carrier)); - this.segment.relatedGlobalTraces(carrier.getDistributedTraceIds()); + this.segment.relatedGlobalTraces(carrier.getDistributedTraceId()); } /** @@ -147,7 +147,7 @@ public class TracingContext implements AbstractTracerContext { @Override public void continued(ContextSnapshot snapshot) { this.segment.ref(new TraceSegmentRef(snapshot)); - this.segment.relatedGlobalTraces(snapshot.getDistributedTraceIds()); + this.segment.relatedGlobalTraces(snapshot.getDistributedTraceId()); } /** diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/trace/TraceSegment.java b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/trace/TraceSegment.java index 000e719569..6fcc27622b 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/trace/TraceSegment.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/trace/TraceSegment.java @@ -93,16 +93,9 @@ public class TraceSegment { /** * Establish the line between this segment and all relative global trace ids. - * - * @param distributedTraceIds multi global trace ids. @see {@link DistributedTraceId} */ - public void relatedGlobalTraces(List distributedTraceIds) { - if (distributedTraceIds == null || distributedTraceIds.size() == 0) { - return; - } - for (DistributedTraceId distributedTraceId : distributedTraceIds) { - relatedGlobalTraces.append(distributedTraceId); - } + public void relatedGlobalTraces(DistributedTraceId distributedTraceId) { + relatedGlobalTraces.append(distributedTraceId); } /**