Merge pull request #283 from DataDog/tyler/span-times

Add startTime and Duration methods to MutableSpan interface
This commit is contained in:
Tyler Benson 2018-04-09 23:46:23 +08:00 committed by GitHub
commit f05ddaa19d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -3,6 +3,13 @@ package datadog.trace.api.interceptor;
import java.util.Map;
public interface MutableSpan {
/** @return Start time with nanosecond scale, but millisecond resolution. */
long getStartTime();
/** @return Duration with nanosecond scale. */
long getDurationNano();
String getOperationName();
MutableSpan setOperationName(final String serviceName);

View File

@ -285,11 +285,13 @@ public class DDSpan implements Span, MutableSpan {
return meta;
}
@Override
@JsonGetter("start")
public long getStartTime() {
return startTimeMicro * 1000L;
}
@Override
@JsonGetter("duration")
public long getDurationNano() {
return durationNano.get();