@Test public void testIsServer() throws Exception { SofaTracerSpan clientSpan = (SofaTracerSpan) this.sofaTracer.buildSpan("testIsClient") .withStartTimestamp(111).start(); clientSpan.setTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_CLIENT); SofaTracerSpan serverSpan = (SofaTracerSpan) this.sofaTracer.buildSpan("testIsServer") .withStartTimestamp(111).start(); serverSpan.setTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_SERVER); assertTrue(clientSpan.isClient()); assertTrue(serverSpan.isServer()); }
public boolean isServer() { return Tags.SPAN_KIND_SERVER.equals(tagsWithStr.get(Tags.SPAN_KIND.getKey())); }
SofaTracerSpan implements Span { public boolean isServer() { return Tags.SPAN_KIND_SERVER.equals(tagsWithStr.get(Tags.SPAN_KIND.getKey())); } }
SofaTracerSpan implements Span { public boolean isServer() { return Tags.SPAN_KIND_SERVER.equals(tagsWithStr.get(Tags.SPAN_KIND.getKey())); } SofaTracerSpan(SofaTracer sofaTracer, long startTime, String operationName,
                          SofaTracerSpanContext sofaTracerSpanContext, Map<String, ?> tags);  SofaTracerSpan(SofaTracer sofaTracer, long startTime,
                          List<SofaTracerSpanReferenceRelationship> spanReferences,
                          String operationName, SofaTracerSpanContext sofaTracerSpanContext,
                          Map<String, ?> tags); }
SofaTracerSpan implements Span { public boolean isServer() { return Tags.SPAN_KIND_SERVER.equals(tagsWithStr.get(Tags.SPAN_KIND.getKey())); } SofaTracerSpan(SofaTracer sofaTracer, long startTime, String operationName,
                          SofaTracerSpanContext sofaTracerSpanContext, Map<String, ?> tags);  SofaTracerSpan(SofaTracer sofaTracer, long startTime,
                          List<SofaTracerSpanReferenceRelationship> spanReferences,
                          String operationName, SofaTracerSpanContext sofaTracerSpanContext,
                          Map<String, ?> tags); SofaTracerSpan cloneInstance(); @Override SpanContext context(); @Override void finish(); @Override void finish(long endTime); @Override void close(); @Override Span setTag(String key, String value); @Override Span setTag(String key, boolean value); @Override Span setTag(String key, Number number); @Override Span log(String eventValue); @Override Span log(long currentTime, String eventValue); Span log(LogData logData); @Override Span log(long currentTime, Map<String, ?> map); @Override Span log(Map<String, ?> map); @Override Span log(String eventName, /* @Nullable */Object payload); @Override Span log(long currentTime, String eventName, /* @Nullable */Object payload); @Override Span setBaggageItem(String key, String value); @Override String getBaggageItem(String key); @Override Span setOperationName(String operationName); void reportError(String errorType, Map<String, String> context, Throwable e,
                            String errorSourceApp, String... errorSources); void profile(String profileApp, String protocolType, String profileMessage); SofaTracerSpan getThisAsParentWhenExceedLayer(); List<SofaTracerSpanReferenceRelationship> getSpanReferences(); SofaTracer getSofaTracer(); long getStartTime(); void setStartTime(long startTime); long getEndTime(); void setEndTime(long endTime); long getDurationMicroseconds(); Map<String, String> getTagsWithStr(); Map<String, Boolean> getTagsWithBool(); Map<String, Number> getTagsWithNumber(); String getOperationName(); SofaTracerSpanContext getSofaTracerSpanContext(); List<LogData> getLogs(); String getLogType(); void setLogType(String logType); SofaTracerSpan getParentSofaTracerSpan(); void setParentSofaTracerSpan(SofaTracerSpan parentSofaTracerSpan); boolean isServer(); boolean isClient(); @Override String toString(); }
SofaTracerSpan implements Span { public boolean isServer() { return Tags.SPAN_KIND_SERVER.equals(tagsWithStr.get(Tags.SPAN_KIND.getKey())); } SofaTracerSpan(SofaTracer sofaTracer, long startTime, String operationName,
                          SofaTracerSpanContext sofaTracerSpanContext, Map<String, ?> tags);  SofaTracerSpan(SofaTracer sofaTracer, long startTime,
                          List<SofaTracerSpanReferenceRelationship> spanReferences,
                          String operationName, SofaTracerSpanContext sofaTracerSpanContext,
                          Map<String, ?> tags); SofaTracerSpan cloneInstance(); @Override SpanContext context(); @Override void finish(); @Override void finish(long endTime); @Override void close(); @Override Span setTag(String key, String value); @Override Span setTag(String key, boolean value); @Override Span setTag(String key, Number number); @Override Span log(String eventValue); @Override Span log(long currentTime, String eventValue); Span log(LogData logData); @Override Span log(long currentTime, Map<String, ?> map); @Override Span log(Map<String, ?> map); @Override Span log(String eventName, /* @Nullable */Object payload); @Override Span log(long currentTime, String eventName, /* @Nullable */Object payload); @Override Span setBaggageItem(String key, String value); @Override String getBaggageItem(String key); @Override Span setOperationName(String operationName); void reportError(String errorType, Map<String, String> context, Throwable e,
                            String errorSourceApp, String... errorSources); void profile(String profileApp, String protocolType, String profileMessage); SofaTracerSpan getThisAsParentWhenExceedLayer(); List<SofaTracerSpanReferenceRelationship> getSpanReferences(); SofaTracer getSofaTracer(); long getStartTime(); void setStartTime(long startTime); long getEndTime(); void setEndTime(long endTime); long getDurationMicroseconds(); Map<String, String> getTagsWithStr(); Map<String, Boolean> getTagsWithBool(); Map<String, Number> getTagsWithNumber(); String getOperationName(); SofaTracerSpanContext getSofaTracerSpanContext(); List<LogData> getLogs(); String getLogType(); void setLogType(String logType); SofaTracerSpan getParentSofaTracerSpan(); void setParentSofaTracerSpan(SofaTracerSpan parentSofaTracerSpan); boolean isServer(); boolean isClient(); @Override String toString(); static final char ARRAY_SEPARATOR; }