Refactor TracerContext.finish()
This commit is contained in:
parent
04638c5177
commit
47df503bad
|
|
@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue