diff --git a/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/model/Span.java b/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/model/Span.java index 4cc9971e1e06bb5b6703d908547d4cde7a3924f1..8288f3a69d0f81f399e29dd4e2124808b4f1460a 100644 --- a/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/model/Span.java +++ b/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/model/Span.java @@ -62,15 +62,9 @@ public class Span { * 业务字段
*/ private String businessKey = ""; - /** - * 应用编码 - */ - private String applicationCode; - /** - * 归属用户 - */ - private String username; + private String viewPointId; + private int routeKey; public Span(String operationName) { @@ -89,10 +83,9 @@ public class Span { this.traceId = traceId; this.parentLevel = parentLevel; this.levelId = levelId; - this.applicationCode = Config.SkyWalking.APPLICATION_CODE; - this.username = Config.SkyWalking.USERNAME; this.routeKey = routeKey; this.viewPointId = operationName; + this.startDate = System.currentTimeMillis(); } public TraceId getTraceId() { @@ -115,26 +108,6 @@ public class Span { this.levelId = levelId; } - public long getStartDate() { - return startDate; - } - - public void setStartDate(long startDate) { - this.startDate = startDate; - } - - public byte getStatusCode() { - return statusCode; - } - - public String getExceptionStack() { - return exceptionStack; - } - - public void setExceptionStack(String exceptionStack) { - this.exceptionStack = exceptionStack; - } - public void setSpanType(int spanType) { this.spanType = spanType; } @@ -183,48 +156,20 @@ public class Span { this.businessKey = businessKey; } - public String getApplicationCode() { - return applicationCode; - } - - public void setApplicationCode(String applicationCode) { - this.applicationCode = applicationCode; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public void setViewPointId(String viewPointId) { - this.viewPointId = viewPointId; - } - - public String getViewPointId() { - return viewPointId; - } - public RequestSpan.Builder buildRequestSpan(RequestSpan.Builder builder) { - builder.setTraceId(this.traceId).setParentLevel(this.parentLevel).setLevelId(this.levelId).setSpanType(this.spanType).setApplicationCode(this.applicationCode) - .setUsername(this.username).setRouteKey(routeKey); + builder.setTraceId(this.traceId).setParentLevel(this.parentLevel).setLevelId(this.levelId).setSpanType(this.spanType).setApplicationCode(Config.SkyWalking.APPLICATION_CODE) + .setUsername(Config.SkyWalking.USERNAME).setRouteKey(routeKey); return builder; } public AckSpan.Builder buildAckSpan(AckSpan.Builder builder) { builder.setTraceId(this.traceId).setParentLevel(this.parentLevel).setLevelId(this.levelId) .setCost(System.currentTimeMillis() - this.startDate).setStatusCode(this.statusCode) - .setExceptionStack(this.exceptionStack).setUsername(this.username).setApplicationCode(this.applicationCode) + .setExceptionStack(this.exceptionStack).setUsername(Config.SkyWalking.USERNAME).setApplicationCode(Config.SkyWalking.APPLICATION_CODE) .setViewpointId(this.viewPointId).setRouteKey(routeKey); return builder; } - public void setRouteKey(int routeKey) { - this.routeKey = routeKey; - } - public int getRouteKey() { return routeKey; } diff --git a/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/util/ContextGenerator.java b/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/util/ContextGenerator.java index 6b43f5ee6f7407398b92974bd45153073b527f49..8ef3c6aaea399c76200dad043447db992ed9290a 100644 --- a/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/util/ContextGenerator.java +++ b/skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/util/ContextGenerator.java @@ -50,8 +50,6 @@ public final class ContextGenerator { span = new Span(parentSpan, id.getViewPoint()); } - span.setStartDate(System.currentTimeMillis()); - return span; }