use of org.apache.servicecomb.core.definition.OperationConfig in project java-chassis by ServiceComb.
the class SlowInvocationLogger method onInvocationFinish.
@Subscribe
@AllowConcurrentEvents
public void onInvocationFinish(InvocationFinishEvent event) {
Invocation invocation = event.getInvocation();
OperationConfig operationConfig = invocation.getOperationMeta().getConfig();
if (!operationConfig.isSlowInvocationEnabled() || invocation.getInvocationStageTrace().calcTotalTime() < operationConfig.getNanoSlowInvocation()) {
return;
}
if (!invocation.isConsumer()) {
logSlowProducer(invocation, event.getResponse(), operationConfig);
return;
}
if (invocation.isEdge()) {
logSlowEdge(invocation, event.getResponse(), operationConfig);
return;
}
logSlowConsumer(invocation, event.getResponse(), operationConfig);
}
Aggregations