-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
431 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
profiler/src/main/java/com/navercorp/pinpoint/profiler/context/DisableAsyncContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.navercorp.pinpoint.profiler.context; | ||
|
||
import com.navercorp.pinpoint.bootstrap.context.AsyncContext; | ||
import com.navercorp.pinpoint.bootstrap.context.Trace; | ||
import com.navercorp.pinpoint.profiler.context.id.LocalTraceRoot; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* @author Woonduk Kang(emeroad) | ||
*/ | ||
public class DisableAsyncContext implements AsyncContext { | ||
private final LocalTraceRoot traceRoot; | ||
private final AsyncTraceContext asyncTraceContext; | ||
|
||
public DisableAsyncContext(LocalTraceRoot traceRoot, AsyncTraceContext asyncTraceContext) { | ||
this.traceRoot = Objects.requireNonNull(traceRoot, "traceRoot"); | ||
this.asyncTraceContext = Objects.requireNonNull(asyncTraceContext, "asyncTraceContext"); | ||
} | ||
|
||
@Override | ||
public Trace continueAsyncTraceObject() { | ||
final Reference<Trace> reference = asyncTraceContext.currentRawTraceObject(); | ||
final Trace nestedTrace = reference.get(); | ||
if (nestedTrace != null) { | ||
return nestedTrace; | ||
} | ||
return asyncTraceContext.continueDisableAsyncContextTraceObject(traceRoot); | ||
} | ||
|
||
@Override | ||
public Trace currentAsyncTraceObject() { | ||
final Reference<Trace> reference = asyncTraceContext.currentRawTraceObject(); | ||
return reference.get(); | ||
} | ||
|
||
@Override | ||
public void close() { | ||
asyncTraceContext.removeTraceObject(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
profiler/src/main/java/com/navercorp/pinpoint/profiler/context/DisableAsyncState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.navercorp.pinpoint.profiler.context; | ||
|
||
import com.navercorp.pinpoint.bootstrap.context.AsyncState; | ||
|
||
/** | ||
* @author Woonduk Kang(emeroad) | ||
*/ | ||
public class DisableAsyncState implements AsyncState { | ||
@Override | ||
public void setup() { | ||
|
||
} | ||
|
||
@Override | ||
public boolean await() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void finish() { | ||
|
||
} | ||
} |
Oops, something went wrong.