提交 47df503b 编写于 作者: wu-sheng's avatar wu-sheng

Refactor TracerContext.finish()

上级 04638c51
......@@ -93,9 +93,12 @@ public class TraceSegment {
/**
* Finish this {@link TraceSegment}.
*
* return this, for chaining
*/
public void finish(){
public TraceSegment finish(){
this.endTime = System.currentTimeMillis();
return this;
}
public String getTraceSegmentId() {
......
......@@ -78,13 +78,15 @@ public final class TracerContext {
}
if (activeSpanStack.isEmpty()) {
segment.finish();
this.finish();
}
}
/**
* Finish this context, and notify all {@link TracerContextListener}s, managed by {@link ListenerManager}
*/
private void finish() {
ListenerManager.notifyFinish(segment);
ListenerManager.notifyFinish(segment.finish());
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册