adjust the comment
This commit is contained in:
parent
fff0eac6cf
commit
fe4aa75c4e
|
|
@ -36,6 +36,15 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceM
|
|||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
|
||||
|
||||
/**
|
||||
* {@link AsyncCallInterceptor} get the `EnhanceRequiredInfo` instance from `SkyWalkingDynamicField` and then put it
|
||||
* into `AsyncCall` instance when the `AsyncCall` constructor called.
|
||||
*
|
||||
* {@link AsyncCallInterceptor} also create an exit span by using the `EnhanceRequiredInfo` when the `execute` method
|
||||
* called.
|
||||
*
|
||||
* @author zhangxin
|
||||
*/
|
||||
public class AsyncCallInterceptor implements InstanceConstructorInterceptor, InstanceMethodsAroundInterceptor {
|
||||
@Override
|
||||
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,12 @@ package org.apache.skywalking.apm.plugin.okhttp.v3;
|
|||
import org.apache.skywalking.apm.agent.core.context.ContextSnapshot;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
|
||||
|
||||
/**
|
||||
* {@link EnhanceRequiredInfo} storage the `ContextSnapshot` and `RealCall` instances for support the async function of
|
||||
* okhttp client.
|
||||
*
|
||||
* @author zhangxin
|
||||
*/
|
||||
public class EnhanceRequiredInfo {
|
||||
private ContextSnapshot contextSnapshot;
|
||||
private EnhancedInstance realCallEnhance;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,13 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceC
|
|||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
|
||||
/**
|
||||
* {@link EnqueueInterceptor} create a local span and the prefix of the span operation name is start with `Async` when
|
||||
* the `enqueue` method called and also put the `ContextSnapshot` and `RealCall` instance into the
|
||||
* `SkyWalkingDynamicField`.
|
||||
*
|
||||
* @author zhangxin
|
||||
*/
|
||||
public class EnqueueInterceptor implements InstanceMethodsAroundInterceptor, InstanceConstructorInterceptor {
|
||||
@Override
|
||||
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
|
||||
|
|
@ -35,12 +42,13 @@ public class EnqueueInterceptor implements InstanceMethodsAroundInterceptor, Ins
|
|||
ContextManager.createLocalSpan("Async" + request.url().uri().getPath());
|
||||
|
||||
/**
|
||||
* Here is the process how to buried the point of async function.
|
||||
* Here is the process about how to trace the async function.
|
||||
*
|
||||
* 1. Storage `Request` object into `RealCall` instance when the constructor of `RealCall` called.
|
||||
* 2. Put the `RealCall` instance to `CallBack` instance
|
||||
* 3. Get the `RealCall` instance into `AsyncCall` instance when the constructor of `RealCall` called.
|
||||
* 4. Create the exist span by using the `RealCall` instance when `AsyncCall` method called.
|
||||
* 3. Get the `RealCall` instance from `CallBack` and then Put the `RealCall` into `AsyncCall` instance
|
||||
* since the constructor of `RealCall` called.
|
||||
* 5. Create the exit span by using the `RealCall` instance when `AsyncCall` method called.
|
||||
*/
|
||||
|
||||
callbackInstance.setSkyWalkingDynamicField(new EnhanceRequiredInfo(objInst, ContextManager.capture()));
|
||||
|
|
|
|||
Loading…
Reference in New Issue