zhengyangyong commented on a change in pull request #468: [SCB-126] Add Consumer side event trigger for collect metrics data URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/468#discussion_r159149018
########## File path: core/src/main/java/io/servicecomb/core/provider/consumer/InvokerUtils.java ########## @@ -72,18 +76,23 @@ public static Response innerSyncInvoke(Invocation invocation) { String.format("invoke failed, %s", invocation.getOperationMeta().getMicroserviceQualifiedName()); LOGGER.debug(msg, e); return Response.createConsumerFail(e); + } finally { + invocation.triggerFinishedEvent(); } } public static void reactiveInvoke(Invocation invocation, AsyncResponse asyncResp) { try { + triggerStartedEvent(invocation); ReactiveResponseExecutor respExecutor = new ReactiveResponseExecutor(); invocation.setResponseExecutor(respExecutor); invocation.next(asyncResp); } catch (Throwable e) { LOGGER.error("invoke failed, {}", invocation.getOperationMeta().getMicroserviceQualifiedName()); asyncResp.consumerFail(e); + } finally { + invocation.triggerFinishedEvent(); Review comment: wrapped asyncResp for triggerFinishedEvent in callback ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services