use of com.alibaba.dubbo.rpc.Invocation in project uavstack by uavorg.
the class DubboIT method doMonitor.
public void doMonitor(Object[] args, boolean isDoCap, Throwable e) {
Invoker<?> invoker = (Invoker<?>) args[0];
Invocation invocation = (Invocation) args[1];
Result result = null;
if (isDoCap && args.length == 3) {
result = (Result) args[2];
}
// consumer
if (Constants.CONSUMER_SIDE.equals(invoker.getUrl().getParameter(Constants.SIDE_KEY))) {
consumerCap(isDoCap, e, invoker, invocation, result);
} else // provider
{
providerCap(isDoCap, e, invoker, invocation, result);
}
}
use of com.alibaba.dubbo.rpc.Invocation in project uavstack by uavorg.
the class DubboConsumerAdapter method afterPreCap.
@Override
public void afterPreCap(InvokeChainContext context, Object[] args) {
String url = (String) context.get(InvokeChainConstants.CLIENT_SPAN_THREADLOCAL_STOREKEY);
Span span = this.spanFactory.getSpanFromContext(url);
String spanMeta = this.spanFactory.getSpanMeta(span);
RpcContext.getContext().setAttachment(InvokeChainConstants.PARAM_RPCHEAD_SPANINFO, spanMeta);
if (UAVServer.instance().isExistSupportor("com.creditease.uav.apm.supporters.SlowOperSupporter")) {
SlowOperContext slowOperContext = new SlowOperContext();
// dubbo虽属于rpc,但从其使用方式上属于方法级
Invocation invocation = (Invocation) args[1];
slowOperContext.put(SlowOperConstants.PROTOCOL_METHOD_PARAMS, parseParams(invocation.getArguments()));
Object[] params = { span, slowOperContext };
UAVServer.instance().runSupporter("com.creditease.uav.apm.supporters.SlowOperSupporter", "runCap", span.getEndpointInfo().split(",")[0], InvokeChainConstants.CapturePhase.PRECAP, context, params);
}
}
Aggregations