提交 947fed48 编写于 作者: wu-sheng's avatar wu-sheng

Begin to refactor for performance.

上级 d397151e
......@@ -18,7 +18,6 @@ import org.skywalking.apm.collector.worker.Const;
import org.skywalking.apm.collector.worker.segment.SegmentIndex;
import org.skywalking.apm.collector.worker.segment.mock.SegmentMock;
import org.skywalking.apm.collector.worker.storage.GetResponseFromEs;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import java.util.TimeZone;
......
......@@ -10,7 +10,6 @@ import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.skywalking.apm.agent.core.boot.ServiceManager;
import org.skywalking.apm.agent.core.conf.Config;
import org.skywalking.apm.agent.core.context.trace.SegmentsMessage;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.queue.TraceSegmentProcessQueue;
import org.skywalking.apm.logging.ILog;
......
package org.skywalking.apm.agent.core.context;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.context.trace.SpanType;
/**
* The <code>AbstractTracerContext</code> represents the tracer context manager.
......@@ -14,15 +15,11 @@ public interface AbstractTracerContext {
String getGlobalTraceId();
AbstractSpan createSpan(String operationName, boolean isLeaf);
AbstractSpan createSpan(String operationName, long startTime, boolean isLeaf);
AbstractSpan createSpan(String operationName, SpanType spanType);
AbstractSpan activeSpan();
void stopSpan(AbstractSpan span);
void stopSpan(AbstractSpan span, Long endTime);
void dispose();
}
......@@ -5,7 +5,6 @@ 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;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.util.StringUtil;
......
......@@ -5,8 +5,6 @@ import java.util.List;
import org.skywalking.apm.agent.core.boot.ServiceManager;
import org.skywalking.apm.agent.core.conf.Config;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.context.trace.LeafSpan;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.context.trace.TraceSegmentRef;
import org.skywalking.apm.agent.core.sampling.SamplingService;
......
package org.skywalking.apm.agent.core.context;
import java.util.LinkedList;
import org.skywalking.apm.agent.core.boot.ServiceManager;
import org.skywalking.apm.agent.core.conf.Config;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.context.trace.AbstractTracingSpan;
import org.skywalking.apm.agent.core.context.trace.SpanType;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.dictionary.DictionaryManager;
import org.skywalking.apm.agent.core.sampling.SamplingService;
/**
* @author wusheng
*/
public class TracingContext implements AbstractTracerContext {
private SamplingService samplingService;
private TraceSegment segment;
/**
* Active spans stored in a Stack, usually called 'ActiveSpanStack'.
* This {@link LinkedList} is the in-memory storage-structure.
* <p>
* I use {@link LinkedList#removeLast()}, {@link LinkedList#addLast(Object)} and {@link LinkedList#last} instead of
* {@link #pop()}, {@link #push(AbstractTracingSpan)}, {@link #peek()}
*/
private LinkedList<AbstractTracingSpan> activeSpanStack = new LinkedList<AbstractTracingSpan>();
private int spanIdGenerator;
TracingContext() {
this.segment = new TraceSegment(DictionaryManager.getApplicationDictionary().findId(Config.Agent.APPLICATION_CODE));
this.spanIdGenerator = 0;
if (samplingService == null) {
samplingService = ServiceManager.INSTANCE.findService(SamplingService.class);
}
}
@Override
public void inject(ContextCarrier carrier) {
}
@Override
public void extract(ContextCarrier carrier) {
}
@Override
public String getGlobalTraceId() {
return null;
}
@Override
public AbstractSpan createSpan(String operationName, SpanType spanType) {
return null;
}
@Override
public AbstractSpan activeSpan() {
return null;
}
@Override
public void stopSpan(AbstractSpan span) {
}
@Override
public void dispose() {
}
/**
* @return the top element of 'ActiveSpanStack', and remove it.
*/
private AbstractTracingSpan pop() {
return activeSpanStack.removeLast();
}
/**
* Add a new Span at the top of 'ActiveSpanStack'
*
* @param span
*/
private void push(AbstractTracingSpan span) {
activeSpanStack.addLast(span);
}
/**
* @return the top element of 'ActiveSpanStack' only.
*/
private AbstractTracingSpan peek() {
if (activeSpanStack.isEmpty()) {
return null;
}
return activeSpanStack.getLast();
}
}
package org.skywalking.apm.agent.core.context.tag;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.context.trace.Span;
/**
* This is the abstract tag.
......
package org.skywalking.apm.agent.core.context.trace;
import java.util.Map;
import java.util.LinkedList;
import java.util.List;
import org.skywalking.apm.agent.core.context.util.KeyValuePair;
import org.skywalking.apm.agent.core.context.util.ThrowableTransformer;
/**
* The <code>AbstractSpan</code> represents the span's skeleton,
......@@ -8,24 +11,70 @@ import java.util.Map;
*
* @author wusheng
*/
public interface AbstractSpan {
AbstractSpan setOperationName(String operationName);
public abstract class AbstractSpan {
protected String operationName;
/**
* The start time of this Span.
*/
protected long startTime;
/**
* The end time of this Span.
*/
protected long endTime;
void setPeerHost(String peerHost);
/**
* Log is a concept from OpenTracing spec.
* <p>
* {@see https://github.com/opentracing/specification/blob/master/specification.md#log-structured-data}
*/
protected List<LogDataEntity> logs;
void setPort(int port);
protected AbstractSpan(String operationName) {
this.operationName = operationName;
}
void setPeers(String peers);
public void start() {
this.startTime = System.currentTimeMillis();
}
AbstractSpan setTag(String key, String value);
/**
* Set a key:value tag on the Span.
*
* @return this Span instance, for chaining
*/
public abstract AbstractSpan tag(String key, String value);
AbstractSpan setTag(String key, boolean value);
/**
* Record an exception event of the current walltime timestamp.
*
* @param t any subclass of {@link Throwable}, which occurs in this span.
* @return the Span, for chaining
*/
public AbstractSpan log(Throwable t) {
if (logs == null) {
logs = new LinkedList<LogDataEntity>();
}
logs.add(new LogDataEntity.Builder()
.add(new KeyValuePair("event", "error"))
.add(new KeyValuePair("error.kind", t.getClass().getName()))
.add(new KeyValuePair("message", t.getMessage()))
.add(new KeyValuePair("stack", ThrowableTransformer.INSTANCE.convert2String(t, 4000)))
.build());
return this;
}
AbstractSpan setTag(String key, Integer value);
/**
* @return true if the actual span is an entry span.
*/
public abstract boolean isEntry();
AbstractSpan log(Map<String, String> fields);
/**
* @return true if the actual span is a local span.
*/
public abstract boolean isLocal();
AbstractSpan log(Throwable t);
AbstractSpan log(String event);
/**
* @return true if the actual span is an exit span.
*/
public abstract boolean isExit();
}
package org.skywalking.apm.agent.core.context.trace;
import java.util.LinkedList;
import java.util.List;
import org.skywalking.apm.agent.core.context.util.KeyValuePair;
/**
* The <code>AbstractTracingSpan</code> represents a group of {@link AbstractSpan} implementations,
* which belongs a real distributed trace.
*
* @author wusheng
*/
public abstract class AbstractTracingSpan extends AbstractSpan {
protected int spanId;
protected int parentSpanId;
protected List<KeyValuePair> tags;
protected AbstractTracingSpan(int spanId, int parentSpanId, String operationName) {
super(operationName);
this.spanId = spanId;
this.parentSpanId = parentSpanId;
}
@Override
public AbstractTracingSpan tag(String key, String value) {
if (tags == null) {
tags = new LinkedList<KeyValuePair>();
}
tags.add(new KeyValuePair(key, value));
return this;
}
/**
* Finish the active Span.
* When it is finished, it will be archived by the given {@link TraceSegment}, which owners it.
*
* @param owner of the Span.
*/
public void finish(TraceSegment owner) {
this.endTime = System.currentTimeMillis();
owner.archive(this);
}
}
package org.skywalking.apm.agent.core.context.trace;
/**
* The <code>EntrySpan</code> represents a service provider point, such as Tomcat server entrance.
*
* It is a start point of {@link TraceSegment}, even in a complex application, there maybe have multi entry point,
* the <code>EntrySpan</code> only represents the first one.
*
* But with the last <code>EntrySpan</code>'s tags and logs, which have more details about a service provider.
*
* @author wusheng
*/
public class EntrySpan extends AbstractTracingSpan {
private int stackDepth;
public EntrySpan(int spanId, int parentSpanId, String operationName) {
super(spanId, parentSpanId, operationName);
this.stackDepth = 0;
}
/**
* Set the {@link #startTime}, when the first start, which means the first service provided.
*/
@Override
public void start() {
if (++stackDepth == 1) {
super.start();
}
clearWhenRestart();
}
@Override
public EntrySpan tag(String key, String value) {
if (stackDepth == 1) {
super.tag(key, value);
}
return this;
}
@Override
public void finish(TraceSegment owner) {
if (--stackDepth == 0) {
super.finish(owner);
}
}
@Override
public EntrySpan log(Throwable t) {
super.log(t);
return this;
}
@Override public boolean isEntry() {
return true;
}
@Override public boolean isLocal() {
return false;
}
@Override public boolean isExit() {
return false;
}
private void clearWhenRestart() {
this.logs = null;
this.tags = null;
}
}
package org.skywalking.apm.agent.core.context.trace;
/**
* The <code>ExitSpan</code> represents a service consumer point, such as Feign, Okhttp client for a Http service.
*
* It is an exit point or a leaf span(our old name) of trace tree.
* In a single rpc call, because of a combination of client libs, there maybe contain multi exit point.
*
* The <code>ExitSpan</code> only presents the first one.
*
* @author wusheng
*/
public class ExitSpan extends AbstractTracingSpan {
private int stackDepth;
private String peerPoint;
public ExitSpan(int spanId, int parentSpanId, String operationName, String peerPoint) {
super(spanId, parentSpanId, operationName);
this.stackDepth = 0;
this.peerPoint = peerPoint;
}
/**
* Set the {@link #startTime}, when the first start, which means the first service provided.
*/
@Override
public void start() {
if (++stackDepth == 1) {
super.start();
}
}
@Override
public ExitSpan tag(String key, String value) {
if (stackDepth == 1) {
super.tag(key, value);
}
return this;
}
@Override
public void finish(TraceSegment owner) {
if (--stackDepth == 0) {
super.finish(owner);
}
}
@Override
public ExitSpan log(Throwable t) {
if (stackDepth == 1) {
super.log(t);
}
return this;
}
@Override public boolean isEntry() {
return false;
}
@Override public boolean isLocal() {
return false;
}
@Override public boolean isExit() {
return true;
}
}
package org.skywalking.apm.agent.core.context.trace;
/**
* LeafSpan is a special type of {@link Span}
*
* In rpc-client tracing scenario, one component could constitute by many other rpc-client.
* e.g Feign constitutes by okhttp, apache httpclient, etc.
*
* By having leaf concept, no need so many spans for single rpc call.
*
* @author wusheng
*/
public class LeafSpan extends Span {
private int stackDepth = 0;
/**
* Create a new span, by given span id and give startTime but no parent span id,
* No parent span id means that, this Span is the first span of the {@link TraceSegment}
*
* @param spanId given by the creator, and must be unique id in the {@link TraceSegment}
* @param operationName {@link #operationName}
* @param startTime given start time of span
*/
public LeafSpan(int spanId, String operationName, long startTime) {
super(spanId, -1, operationName, startTime);
}
/**
* Create a new span, by given span id, parent span, operationName and startTime.
* This span must belong a {@link TraceSegment}, also is a part of Distributed Trace.
*
* @param spanId given by the creator, and must be unique id in the {@link TraceSegment}
* @param parentSpan {@link Span}
* @param operationName {@link #operationName}
* @param startTime given start timestamp
*/
public LeafSpan(int spanId, Span parentSpan, String operationName, long startTime) {
super(spanId, parentSpan.getSpanId(), operationName, startTime);
}
public void push() {
stackDepth++;
}
public void pop() {
stackDepth--;
}
public boolean isFinished() {
return stackDepth == 0;
}
@Override
public boolean isLeaf() {
return true;
}
private boolean isInOwnerContext() {
return stackDepth == 1;
}
/**
* Sets the string name for the logical operation this span represents,
* only when this is in context of the leaf span owner.
*
* @return this Span instance, for chaining
*/
@Override
public Span setOperationName(String operationName) {
if (isInOwnerContext()) {
super.setOperationName(operationName);
}
return this;
}
/**
* Set a key:value tag on the Span,
* only when this is in context of the leaf span owner.
*
* @return this Span instance, for chaining
*/
@Override
public final Span setTag(String key, String value) {
if (isInOwnerContext()) {
super.setTag(key, value);
}
return this;
}
@Override
public final Span setTag(String key, boolean value) {
if (isInOwnerContext()) {
super.setTag(key, value);
}
return this;
}
@Override
public final Span setTag(String key, Integer value) {
if (isInOwnerContext()) {
super.setTag(key, value);
}
return this;
}
}
package org.skywalking.apm.agent.core.context.trace;
/**
* The <code>LocalSpan</code> represents a normal tracing point, such as a local method.
*
* @author wusheng
*/
public class LocalSpan extends AbstractTracingSpan {
public LocalSpan(int spanId, int parentSpanId, String operationName) {
super(spanId, parentSpanId, operationName);
}
@Override
public LocalSpan tag(String key, String value) {
super.tag(key, value);
return this;
}
@Override
public LocalSpan log(Throwable t) {
super.log(t);
return this;
}
@Override public boolean isEntry() {
return false;
}
@Override public boolean isLocal() {
return true;
}
@Override public boolean isExit() {
return false;
}
}
package org.skywalking.apm.agent.core.context.trace;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.Collections;
import java.util.Map;
/**
* It is a holder of one log record.
* <p>
* Created by wusheng on 2017/2/17.
*/
public class LogData {
@Expose
@SerializedName(value = "tm")
private long time;
@Expose
@SerializedName(value = "fi")
private Map<String, String> fields;
LogData(long time, Map<String, String> fields) {
this.time = time;
if (fields == null) {
throw new NullPointerException();
}
this.fields = fields;
}
public LogData() {
}
public long getTime() {
return time;
}
public Map<String, ?> getFields() {
return Collections.unmodifiableMap(fields);
}
}
package org.skywalking.apm.agent.core.context.trace;
import java.util.LinkedList;
import java.util.List;
import org.skywalking.apm.agent.core.context.util.KeyValuePair;
/**
* The <code>LogDataEntity</code> represents a collection of {@link KeyValuePair},
* contains several fields of a logging operation.
*
* @author wusheng
*/
public class LogDataEntity {
protected List<KeyValuePair> logs;
private LogDataEntity(List<KeyValuePair> logs) {
this.logs = logs;
}
public List<KeyValuePair> getLogs() {
return logs;
}
public static class Builder {
protected List<KeyValuePair> logs;
public Builder() {
logs = new LinkedList<KeyValuePair>();
}
public Builder add(KeyValuePair... fields){
for (KeyValuePair field : fields) {
logs.add(field);
}
return this;
}
public LogDataEntity build(){
return new LogDataEntity(logs);
}
}
}
package org.skywalking.apm.agent.core.context.trace;
import java.util.Map;
import org.skywalking.apm.agent.core.context.IgnoredTracerContext;
/**
......@@ -9,55 +8,39 @@ import org.skywalking.apm.agent.core.context.IgnoredTracerContext;
*
* @author wusheng
*/
public class NoopSpan implements AbstractSpan {
@Override
public AbstractSpan setOperationName(String operationName) {
return this;
}
@Override
public void setPeerHost(String peerHost) {
public class NoopSpan extends AbstractSpan {
public NoopSpan() {
super(null);
}
@Override
public void setPort(int port) {
public void start() {
super.start();
}
@Override
public void setPeers(String peers) {
public AbstractSpan log(Throwable t) {
return super.log(t);
}
@Override
public AbstractSpan setTag(String key, String value) {
return this;
}
public void finish(){
@Override
public AbstractSpan setTag(String key, boolean value) {
return this;
}
@Override
public AbstractSpan setTag(String key, Integer value) {
return this;
public AbstractSpan tag(String key, String value) {
return null;
}
@Override
public AbstractSpan log(Map<String, String> fields) {
return this;
@Override public boolean isEntry() {
return false;
}
@Override
public AbstractSpan log(Throwable t) {
return this;
@Override public boolean isLocal() {
return false;
}
@Override
public AbstractSpan log(String event) {
return this;
@Override public boolean isExit() {
return false;
}
}
package org.skywalking.apm.agent.core.context.trace;
import com.google.gson.Gson;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* The <code>SegmentsMessage</code> is a set of {@link TraceSegment},
* this set provides a container, when several {@link TraceSegment}s are going to uplink to server.
*
* @author wusheng
*/
public class SegmentsMessage {
private List<TraceSegment> segments;
public SegmentsMessage() {
segments = new LinkedList<TraceSegment>();
}
public void append(TraceSegment segment) {
this.segments.add(segment);
}
public List<TraceSegment> getSegments() {
return Collections.unmodifiableList(segments);
}
/**
* This serialization mechanism started from 3.1, it is similar to network package.
* The data protocol is
*
* segment1.json.length + ' '(one blank space) + segment1.json
* + segment2.json.length + ' '(one blank space) + segment2.json
* + etc.
*
* @param gson the serializer for {@link TraceSegment}
* @return the string represents the <code>SegmentMessage</code>
*/
public String serialize(Gson gson) {
StringBuilder buffer = new StringBuilder();
for (TraceSegment segment : segments) {
String segmentJson = gson.toJson(segment);
buffer.append(segmentJson.length()).append(' ').append(segmentJson);
}
return buffer.toString();
}
}
package org.skywalking.apm.agent.core.context.trace;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.skywalking.apm.agent.core.context.tag.BooleanTagItem;
import org.skywalking.apm.agent.core.context.tag.IntTagItem;
import org.skywalking.apm.agent.core.context.tag.StringTagItem;
import org.skywalking.apm.agent.core.context.util.ThrowableTransformer;
import org.skywalking.apm.util.StringUtil;
/**
* Span is a concept from OpenTracing Spec, also from Google Dapper Paper.
* Traces in OpenTracing are defined implicitly by their Spans.
* <p>
* Know more things about span concept:
* {@see https://github.com/opentracing/specification/blob/master/specification.md#the-opentracing-data-model}
* <p>
* Created by wusheng on 2017/2/17.
*/
@JsonAdapter(Span.Serializer.class)
public class Span implements AbstractSpan {
private static Gson SERIALIZATION_GSON = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
private int spanId;
private int parentSpanId;
/**
* The start time of this Span.
*/
private long startTime;
/**
* The end time of this Span.
*/
private long endTime;
/**
* The operation name ot this Span.
* If you want to know, how to set an operation name,
* {@see https://github.com/opentracing/specification/blob/master/specification.md#start-a-new-span}
*/
private String operationName;
/**
* {@link #peerHost}, {@link #port} and {@link #peers} were part of tags,
* independence them from tags for better performance and gc.
*/
private String peerHost;
private int port;
private String peers;
/**
* Tag is a concept from OpenTracing spec.
* <p>
* {@see https://github.com/opentracing/specification/blob/master/specification.md#set-a-span-tag}
*/
private List<StringTagItem> tagsWithStr;
private List<BooleanTagItem> tagsWithBool;
private List<IntTagItem> tagsWithInt;
/**
* Log is a concept from OpenTracing spec.
* <p>
* {@see https://github.com/opentracing/specification/blob/master/specification.md#log-structured-data}
*/
private List<LogData> logs;
/**
* Create a new span, by given span id, parent span id and operationName.
* This span must belong a {@link TraceSegment}, also is a part of Distributed Trace.
*
* @param spanId given by the creator, and must be unique id in the {@link TraceSegment}
* @param parentSpanId given by the creator, and must be an existed span id in the {@link TraceSegment}. Value -1
* means no parent span if this {@link TraceSegment}.
* @param operationName {@link #operationName}
*/
protected Span(int spanId, int parentSpanId, String operationName) {
this(spanId, parentSpanId, operationName, System.currentTimeMillis());
}
/**
* Create a new span, by given span id, parent span id, operationName and startTime.
* This span must belong a {@link TraceSegment}, also is a part of Distributed Trace.
*
* @param spanId given by the creator, and must be unique id in the {@link TraceSegment}
* @param parentSpanId given by the creator, and must be an existed span id in the {@link TraceSegment}. Value -1
* means no parent span if this {@link TraceSegment}.
* @param operationName {@link #operationName}
* @param startTime given start timestamp.
*/
protected Span(int spanId, int parentSpanId, String operationName, long startTime) {
this();
this.spanId = spanId;
this.parentSpanId = parentSpanId;
this.startTime = startTime;
this.setOperationName(operationName);
}
/**
* Create a new span, by given span id and no parent span id.
* No parent span id means that, this Span is the first span of the {@link TraceSegment}
*
* @param spanId given by the creator, and must be unique id in the {@link TraceSegment}
* @param operationName {@link #operationName}
*/
public Span(int spanId, String operationName) {
this(spanId, -1, operationName);
}
/**
* Create a new span, by given span id and give startTime but no parent span id,
* No parent span id means that, this Span is the first span of the {@link TraceSegment}
*
* @param spanId given by the creator, and must be unique id in the {@link TraceSegment}
* @param operationName {@link #operationName}
* @param startTime given start time of span
*/
public Span(int spanId, String operationName, long startTime) {
this(spanId, -1, operationName, startTime);
}
/**
* Create a new span, by given span id and given parent {@link Span}.
*
* @param spanId given by the creator, and must be unique id in the {@link TraceSegment}
* @param parentSpan {@link Span}
* @param operationName {@link #operationName}
*/
public Span(int spanId, Span parentSpan, String operationName) {
this(spanId, parentSpan.spanId, operationName, System.currentTimeMillis());
}
/**
* Create a new span, by given span id, parent span, operationName and startTime.
* This span must belong a {@link TraceSegment}, also is a part of Distributed Trace.
*
* @param spanId given by the creator, and must be unique id in the {@link TraceSegment}
* @param parentSpan {@link Span}
* @param operationName {@link #operationName}
* @param startTime given start timestamp
*/
public Span(int spanId, Span parentSpan, String operationName, long startTime) {
this(spanId, parentSpan.spanId, operationName, startTime);
}
/**
* Create a new/empty span.
*/
public Span() {
}
/**
* Finish the active Span.
* When it is finished, it will be archived by the given {@link TraceSegment}, which owners it.
*
* @param owner of the Span.
*/
public void finish(TraceSegment owner) {
this.finish(owner, System.currentTimeMillis());
}
/**
* Finish the active Span.
* When it is finished, it will be archived by the given {@link TraceSegment}, which owners it.
* At the same out, set the {@link #endTime} as the given endTime
*
* @param owner of the Span.
* @param endTime of the Span.
*/
public void finish(TraceSegment owner, long endTime) {
this.endTime = endTime;
owner.archive(this);
}
/**
* Set the string name for the logical operation this span represents.
*
* @return this Span instance, for chaining
*/
public AbstractSpan setOperationName(String operationName) {
this.operationName = operationName;
return this;
}
/**
* Set a key:value tag on the Span.
*
* @return this Span instance, for chaining
*/
public Span setTag(String key, String value) {
if (tagsWithStr == null) {
tagsWithStr = new LinkedList<StringTagItem>();
}
tagsWithStr.add(new StringTagItem(key, value));
return this;
}
public Span setTag(String key, boolean value) {
if (tagsWithBool == null) {
tagsWithBool = new LinkedList<BooleanTagItem>();
}
tagsWithBool.add(new BooleanTagItem(key, value));
return this;
}
public Span setTag(String key, Integer value) {
if (tagsWithInt == null) {
tagsWithInt = new LinkedList<IntTagItem>();
}
tagsWithInt.add(new IntTagItem(key, value));
return this;
}
/**
* This method is from opentracing-java. {@see https://github.com/opentracing/opentracing-java/blob/release-0.20.9/opentracing-api/src/main/java/io/opentracing/Span.java#L91}
* <p> Log key:value pairs to the Span with the current walltime timestamp. <p> <p><strong>CAUTIONARY NOTE:</strong>
* not all Tracer implementations support key:value log fields end-to-end. Caveat emptor. <p> <p>A contrived example
* (using Guava, which is not required):
* <pre>{@code
* span.log(
* ImmutableMap.Builder<String, Object>()
* .put("event", "soft error")
* .put("type", "cache timeout")
* .put("waited.millis", 1500)
* .build());
* }</pre>
*
* @param fields key:value log fields. Tracer implementations should support String, numeric, and boolean values;
* some may also support arbitrary Objects.
* @return the Span, for chaining
* @see Span#log(String)
*/
public Span log(Map<String, String> fields) {
if (logs == null) {
logs = new LinkedList<LogData>();
}
logs.add(new LogData(System.currentTimeMillis(), fields));
return this;
}
/**
* Record an exception event of the current walltime timestamp.
*
* @param t any subclass of {@link Throwable}, which occurs in this span.
* @return the Span, for chaining
*/
public Span log(Throwable t) {
Map<String, String> exceptionFields = new HashMap<String, String>();
exceptionFields.put("event", "error");
exceptionFields.put("error.kind", t.getClass().getName());
exceptionFields.put("message", t.getMessage());
exceptionFields.put("stack", ThrowableTransformer.INSTANCE.convert2String(t, 4000));
return log(exceptionFields);
}
/**
* This method is from opentracing-java. {@see https://github.com/opentracing/opentracing-java/blob/release-0.20.9/opentracing-api/src/main/java/io/opentracing/Span.java#L120}
* <p> Record an event at the current walltime timestamp. <p> Shorthand for <p>
* <pre>{@code
* span.log(Collections.singletonMap("event", event));
* }</pre>
*
* @param event the event value; often a stable identifier for a moment in the Span lifecycle
* @return the Span, for chaining
*/
public Span log(String event) {
log(Collections.singletonMap("event", event));
return this;
}
public int getSpanId() {
return spanId;
}
public int getParentSpanId() {
return parentSpanId;
}
public long getStartTime() {
return startTime;
}
public long getEndTime() {
return endTime;
}
public String getOperationName() {
return operationName;
}
public boolean isLeaf() {
return false;
}
public String getPeerHost() {
return peerHost;
}
public int getPort() {
return port;
}
public String getPeers() {
return peers;
}
public void setPeerHost(String peerHost) {
this.peerHost = peerHost;
}
public void setPort(int port) {
this.port = port;
}
public void setPeers(String peers) {
this.peers = peers;
}
@Override
public String toString() {
return "Span{" +
"spanId=" + spanId +
", parentSpanId=" + parentSpanId +
", startTime=" + startTime +
", operationName='" + operationName + '\'' +
'}';
}
public static class Serializer extends TypeAdapter<Span> {
@Override
public void write(JsonWriter out, Span span) throws IOException {
out.beginObject();
out.name("si").value(span.spanId);
out.name("ps").value(span.parentSpanId);
out.name("st").value(span.startTime);
out.name("et").value(span.endTime);
out.name("on").value(span.operationName);
this.writeTags(out, span);
if (span.logs != null) {
out.name("logs").jsonValue(SERIALIZATION_GSON.toJson(span.logs));
}
out.endObject();
}
public void writeTags(JsonWriter out, Span span) throws IOException {
JsonObject tagWithStr = null;
JsonObject tagWithInt = null;
JsonObject tagWithBool = null;
if (!StringUtil.isEmpty(span.peerHost)) {
tagWithStr = new JsonObject();
tagWithStr.addProperty("peer.host", span.peerHost);
tagWithInt = new JsonObject();
tagWithInt.addProperty("peer.port", span.port);
} else if (!StringUtil.isEmpty(span.peers)) {
tagWithStr = new JsonObject();
tagWithStr.addProperty("peers", span.peers);
} else if (span.tagsWithStr != null) {
tagWithStr = new JsonObject();
}
if (span.tagsWithStr != null) {
for (StringTagItem item : span.tagsWithStr) {
tagWithStr.addProperty(item.getKey(), item.getValue());
}
}
if (span.tagsWithInt != null) {
if (tagWithInt != null) {
tagWithInt = new JsonObject();
}
for (IntTagItem item : span.tagsWithInt) {
tagWithInt.addProperty(item.getKey(), item.getValue());
}
}
if (span.tagsWithBool != null) {
tagWithBool = new JsonObject();
for (BooleanTagItem item : span.tagsWithBool) {
tagWithBool.addProperty(item.getKey(), item.getValue());
}
}
if (tagWithStr != null) {
out.name("ts").jsonValue(tagWithStr.toString());
}
if (tagWithInt != null) {
out.name("ti").jsonValue(tagWithInt.toString());
}
if (tagWithBool != null) {
out.name("tb").jsonValue(tagWithBool.toString());
}
}
@Override
public Span read(JsonReader in) throws IOException {
throw new IOException("Can't deserialize span at agent side for performance consideration");
}
}
}
package org.skywalking.apm.agent.core.context.trace;
/**
* @author wusheng
*/
public enum SpanType {
ENTRY,
EXIT,
LOCAL;
}
package org.skywalking.apm.agent.core.context.trace;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
......@@ -26,22 +24,16 @@ public class TraceSegment {
* The id of this trace segment.
* Every segment has its unique-global-id.
*/
@Expose
@SerializedName(value = "ts")
private String traceSegmentId;
/**
* The start time of this trace segment.
*/
@Expose
@SerializedName(value = "st")
private long startTime;
/**
* The end time of this trace segment.
*/
@Expose
@SerializedName(value = "et")
private long endTime;
/**
......@@ -50,8 +42,6 @@ public class TraceSegment {
* but if this segment is a start span of batch process, the segment faces multi parents,
* at this moment, we use this {@link #refs} to link them.
*/
@Expose
@SerializedName(value = "rs")
private List<TraceSegmentRef> refs;
/**
......@@ -59,19 +49,15 @@ public class TraceSegment {
* They all have finished.
* All active spans are hold and controlled by "skywalking-api" module.
*/
@Expose
@SerializedName(value = "ss")
private List<Span> spans;
private List<AbstractTracingSpan> spans;
/**
* The <code>applicationCode</code> represents a name of current application/JVM and indicates which is business
* The <code>applicationId</code> represents a name of current application/JVM and indicates which is business
* role in the cluster.
* <p>
* e.g. account_app, billing_app
*/
@Expose
@SerializedName(value = "ac")
private String applicationCode;
private int applicationId;
/**
* The <code>relatedGlobalTraces</code> represent a set of all related trace. Most time it contains only one
......@@ -86,18 +72,16 @@ public class TraceSegment {
* <code>relatedGlobalTraces</code> targets this {@link TraceSegment}'s related call chain, a call chain contains
* multi {@link TraceSegment}s, only using {@link #refs} is not enough for analysis and ui.
*/
@Expose
@SerializedName(value = "gt")
private DistributedTraceIds relatedGlobalTraces;
private boolean ignore = false;
/**
* Create a trace segment, by the given applicationCode.
* Create a trace segment, by the given applicationId.
*/
public TraceSegment(String applicationCode) {
public TraceSegment(int applicationId) {
this();
this.applicationCode = applicationCode;
this.applicationId = applicationId;
}
/**
......@@ -108,7 +92,7 @@ public class TraceSegment {
public TraceSegment() {
this.startTime = System.currentTimeMillis();
this.traceSegmentId = GlobalIdGenerator.generate(ID_TYPE);
this.spans = new LinkedList<Span>();
this.spans = new LinkedList<AbstractTracingSpan>();
this.relatedGlobalTraces = new DistributedTraceIds();
this.relatedGlobalTraces.append(new NewDistributedTraceId());
}
......@@ -142,12 +126,12 @@ public class TraceSegment {
}
/**
* After {@link Span} is finished, as be controller by "skywalking-api" module,
* After {@link AbstractSpan} is finished, as be controller by "skywalking-api" module,
* notify the {@link TraceSegment} to archive it.
*
* @param finishedSpan
*/
public void archive(Span finishedSpan) {
public void archive(AbstractTracingSpan finishedSpan) {
spans.add(finishedSpan);
}
......@@ -173,13 +157,6 @@ public class TraceSegment {
return endTime;
}
public List<TraceSegmentRef> getRefs() {
if (refs == null) {
return null;
}
return Collections.unmodifiableList(refs);
}
public boolean hasRef() {
return !(refs == null || refs.size() == 0);
}
......@@ -192,14 +169,6 @@ public class TraceSegment {
return this.spans != null && this.spans.size() == 1;
}
public List<Span> getSpans() {
return Collections.unmodifiableList(spans);
}
public String getApplicationCode() {
return applicationCode;
}
public boolean isIgnore() {
return ignore;
}
......@@ -216,7 +185,7 @@ public class TraceSegment {
", endTime=" + endTime +
", refs=" + refs +
", spans=" + spans +
", applicationCode='" + applicationCode + '\'' +
", applicationId='" + applicationId + '\'' +
", relatedGlobalTraces=" + relatedGlobalTraces +
'}';
}
......
package org.skywalking.apm.agent.core.context.trace;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import org.skywalking.apm.agent.core.context.tag.Tags;
/**
* {@link TraceSegmentRef} is like a pointer, which ref to another {@link TraceSegment},
* use {@link #spanId} point to the exact span of the ref {@link TraceSegment}.
......@@ -14,29 +10,12 @@ public class TraceSegmentRef {
/**
* {@link TraceSegment#traceSegmentId}
*/
@Expose
@SerializedName(value = "ts")
private String traceSegmentId;
/**
* {@link Span#spanId}
*/
@Expose
@SerializedName(value = "si")
private int spanId = -1;
/**
* {@link TraceSegment#applicationCode}
*/
@Expose
@SerializedName(value = "ac")
private String applicationCode;
/**
* {@link Tags#PEER_HOST}
*/
@Expose
@SerializedName(value = "ph")
private String peerHost;
/**
......
package org.skywalking.apm.agent.core.context.util;
/**
* The <code>KeyValuePair</code> represents a object which contains a string key and a string value.
*
* @author wusheng
*/
public class KeyValuePair {
private String key;
private String value;
public KeyValuePair(String key, String value) {
this.key = key;
this.value = value;
}
public String getKey() {
return key;
}
public String getValue() {
return value;
}
}
package org.skywalking.apm.agent.core.dictionary;
/**
* Map of application id to application code, which is from the collector side.
*
* @author wusheng
*/
public enum ApplicationDictionary {
INSTANCE;
public int findId(String applicationCode) {
}
}
package org.skywalking.apm.agent.core.dictionary;
/**
* @author wusheng
*/
public class DictionaryManager {
/**
* @return {@link ApplicationDictionary} to find applicationId
*/
public static ApplicationDictionary getApplicationDictionary(){
return ApplicationDictionary.INSTANCE;
}
}
......@@ -2,7 +2,6 @@ package org.skywalking.apm.agent.core.context.trace;
import org.junit.Assert;
import org.junit.Test;
import org.skywalking.apm.agent.core.context.trace.LeafSpan;
import org.skywalking.apm.agent.core.tags.BooleanTagReader;
import org.skywalking.apm.agent.core.tags.IntTagReader;
import org.skywalking.apm.agent.core.tags.StringTagReader;
......
......@@ -6,9 +6,6 @@ import org.junit.Assert;
import org.junit.Test;
import org.skywalking.apm.agent.core.tags.BooleanTagReader;
import org.skywalking.apm.agent.core.tags.StringTagReader;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.context.tag.Tags;
/**
......
......@@ -18,7 +18,7 @@ public class TraceSegmentTestCase {
Assert.assertTrue(segment.getTraceSegmentId().startsWith("Segment"));
Assert.assertTrue(segment.getStartTime() > 0);
Assert.assertEquals("billing_app", segment.getApplicationCode());
Assert.assertEquals("billing_app", segment.getApplicationId());
}
@Test
......
......@@ -2,7 +2,6 @@ package org.skywalking.apm.agent.core.tags;
import java.lang.reflect.Field;
import java.util.List;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.tag.BooleanTag;
import org.skywalking.apm.agent.core.context.tag.BooleanTagItem;
......
......@@ -2,7 +2,6 @@ package org.skywalking.apm.agent.core.tags;
import java.lang.reflect.Field;
import java.util.List;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.tag.IntTag;
import org.skywalking.apm.agent.core.context.tag.IntTagItem;
......
......@@ -2,7 +2,6 @@ package org.skywalking.apm.agent.core.tags;
import java.lang.reflect.Field;
import java.util.List;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.tag.StringTag;
import org.skywalking.apm.agent.core.context.tag.StringTagItem;
......
......@@ -148,7 +148,6 @@
<exclude>org.apache.httpcomponents:*</exclude>
<exclude>commons-logging:*</exclude>
<exclude>commons-codec:*</exclude>
<exclude>*:gson</exclude>
</excludes>
</artifactSet>
<relocations>
......
......@@ -27,8 +27,6 @@ import org.skywalking.apm.sniffer.mock.context.MockTracerContextListener;
import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.sniffer.mock.trace.SpanLogReader;
import org.skywalking.apm.sniffer.mock.trace.tags.StringTagReader;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.context.trace.TraceSegmentRef;
import org.skywalking.apm.agent.core.context.tag.Tags;
......
......@@ -16,7 +16,6 @@ import org.skywalking.apm.agent.core.context.ContextCarrier;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.tag.Tags;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.plugin.interceptor.EnhancedClassInstanceContext;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodInvokeContext;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
......
......@@ -22,7 +22,6 @@ import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.sniffer.mock.trace.SpanLogReader;
import org.skywalking.apm.sniffer.mock.trace.tags.BooleanTagReader;
import org.skywalking.apm.sniffer.mock.trace.tags.StringTagReader;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.context.tag.Tags;
......
......@@ -18,8 +18,6 @@ import org.skywalking.apm.sniffer.mock.context.MockTracerContextListener;
import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.sniffer.mock.trace.tags.BooleanTagReader;
import org.skywalking.apm.sniffer.mock.trace.tags.StringTagReader;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.context.tag.Tags;
......
......@@ -4,7 +4,6 @@ import java.sql.SQLException;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.tag.Tags;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.util.StringUtil;
/**
......
......@@ -3,7 +3,6 @@ package org.skywalking.apm.plugin.jdbc;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.util.StringUtil;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.tag.Tags;
import java.sql.SQLException;
......
......@@ -4,7 +4,6 @@ import java.sql.SQLException;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.tag.Tags;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.util.StringUtil;
/**
......
......@@ -4,7 +4,6 @@ import java.sql.SQLException;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.tag.Tags;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.util.StringUtil;
/**
......
......@@ -5,8 +5,6 @@ import java.util.List;
import org.hamcrest.CoreMatchers;
import org.skywalking.apm.sniffer.mock.context.MockTracerContextListener;
import org.skywalking.apm.sniffer.mock.trace.tags.StringTagReader;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.tag.Tags;
import java.sql.SQLException;
......
package org.skywalking.apm.plugin.jdbc;
import com.mysql.cj.api.jdbc.JdbcConnection;
import java.lang.reflect.Field;
import java.util.List;
import org.hamcrest.CoreMatchers;
import org.junit.After;
......@@ -16,8 +15,6 @@ import org.skywalking.apm.agent.core.boot.ServiceManager;
import org.skywalking.apm.agent.core.context.TracerContext;
import org.skywalking.apm.sniffer.mock.context.MockTracerContextListener;
import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import java.io.InputStream;
......
......@@ -13,8 +13,6 @@ import org.skywalking.apm.agent.core.boot.ServiceManager;
import org.skywalking.apm.agent.core.context.TracerContext;
import org.skywalking.apm.sniffer.mock.context.MockTracerContextListener;
import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import java.net.MalformedURLException;
......
......@@ -16,8 +16,6 @@ import org.skywalking.apm.agent.core.boot.ServiceManager;
import org.skywalking.apm.agent.core.context.TracerContext;
import org.skywalking.apm.sniffer.mock.context.MockTracerContextListener;
import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import java.io.InputStream;
......
......@@ -16,10 +16,7 @@ import org.skywalking.apm.agent.core.plugin.interceptor.EnhancedClassInstanceCon
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodInvokeContext;
import org.skywalking.apm.sniffer.mock.context.MockTracerContextListener;
import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.sniffer.mock.trace.tags.BooleanTagReader;
import org.skywalking.apm.sniffer.mock.trace.tags.StringTagReader;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.context.tag.Tags;
......
......@@ -23,8 +23,6 @@ import org.skywalking.apm.sniffer.mock.context.MockTracerContextListener;
import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.sniffer.mock.trace.SpanLogReader;
import org.skywalking.apm.sniffer.mock.trace.tags.StringTagReader;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.context.tag.Tags;
......
......@@ -24,8 +24,6 @@ import org.skywalking.apm.sniffer.mock.context.MockTracerContextListener;
import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.sniffer.mock.trace.SpanLogReader;
import org.skywalking.apm.sniffer.mock.trace.tags.StringTagReader;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.context.tag.Tags;
......
......@@ -19,8 +19,6 @@ import org.skywalking.apm.sniffer.mock.context.MockTracerContextListener;
import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.sniffer.mock.trace.SpanLogReader;
import org.skywalking.apm.sniffer.mock.trace.tags.StringTagReader;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.context.tag.Tags;
......
......@@ -21,8 +21,6 @@ import org.skywalking.apm.sniffer.mock.context.MockTracerContextListener;
import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.sniffer.mock.trace.SpanLogReader;
import org.skywalking.apm.sniffer.mock.trace.tags.StringTagReader;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.context.trace.TraceSegmentRef;
import org.skywalking.apm.agent.core.context.tag.Tags;
......
......@@ -11,7 +11,6 @@ import org.skywalking.apm.agent.core.context.ContextCarrier;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.tag.Tags;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.plugin.interceptor.EnhancedClassInstanceContext;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.ConstructorInvokeContext;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
......
......@@ -20,7 +20,6 @@ import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.sniffer.mock.trace.SpanLogReader;
import org.skywalking.apm.sniffer.mock.trace.tags.BooleanTagReader;
import org.skywalking.apm.sniffer.mock.trace.tags.StringTagReader;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.context.tag.Tags;
......
......@@ -20,8 +20,6 @@ import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.sniffer.mock.trace.SpanLogReader;
import org.skywalking.apm.sniffer.mock.trace.tags.IntTagReader;
import org.skywalking.apm.sniffer.mock.trace.tags.StringTagReader;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.context.trace.TraceSegmentRef;
import org.skywalking.apm.agent.core.context.tag.Tags;
......
......@@ -20,8 +20,6 @@ import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.sniffer.mock.trace.SpanLogReader;
import org.skywalking.apm.sniffer.mock.trace.tags.IntTagReader;
import org.skywalking.apm.sniffer.mock.trace.tags.StringTagReader;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.context.trace.TraceSegmentRef;
import org.skywalking.apm.agent.core.context.tag.Tags;
......
......@@ -20,8 +20,6 @@ import org.skywalking.apm.sniffer.mock.context.SegmentAssert;
import org.skywalking.apm.sniffer.mock.trace.SpanLogReader;
import org.skywalking.apm.sniffer.mock.trace.tags.IntTagReader;
import org.skywalking.apm.sniffer.mock.trace.tags.StringTagReader;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.skywalking.apm.agent.core.context.trace.TraceSegmentRef;
import org.skywalking.apm.agent.core.context.tag.Tags;
......
......@@ -2,8 +2,6 @@ package org.skywalking.apm.sniffer.mock.trace;
import java.lang.reflect.Field;
import java.util.List;
import org.skywalking.apm.agent.core.context.trace.LogData;
import org.skywalking.apm.agent.core.context.trace.Span;
/**
* @author wusheng
......
......@@ -2,7 +2,6 @@ package org.skywalking.apm.sniffer.mock.trace.tags;
import java.lang.reflect.Field;
import java.util.List;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.tag.BooleanTag;
import org.skywalking.apm.agent.core.context.tag.BooleanTagItem;
......
......@@ -2,7 +2,6 @@ package org.skywalking.apm.sniffer.mock.trace.tags;
import java.lang.reflect.Field;
import java.util.List;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.tag.IntTag;
import org.skywalking.apm.agent.core.context.tag.IntTagItem;
......
......@@ -2,7 +2,6 @@ package org.skywalking.apm.sniffer.mock.trace.tags;
import java.lang.reflect.Field;
import java.util.List;
import org.skywalking.apm.agent.core.context.trace.Span;
import org.skywalking.apm.agent.core.context.tag.StringTag;
import org.skywalking.apm.agent.core.context.tag.StringTagItem;
......
......@@ -72,12 +72,6 @@
</properties>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册