justxuewei commented on code in PR #2032:
URL: https://github.com/apache/dubbo-go/pull/2032#discussion_r967594220


##########
cluster/cluster/adaptivesvc/cluster_invoker.go:
##########
@@ -65,45 +64,20 @@ func (ivk *adaptiveServiceClusterInvoker) Invoke(ctx 
context.Context, invocation
 
        // select a node by the loadBalance
        invoker := lb.Select(invokers, invocation)
-
+       _ = 
metrics.SlidingWindowCounterMetrics.SetMethodMetrics(invoker.GetURL(), 
invocation.MethodName(), metrics.Requests, 1)
        // invoke
        invocation.SetAttachment(constant.AdaptiveServiceEnabledKey, 
constant.AdaptiveServiceIsEnabled)
+       startTime := time.Now().UnixNano()
        result := invoker.Invoke(ctx, invocation)
-
+       rtt := time.Now().UnixNano() - startTime
        // if the adaptive service encounters an error, DO NOT
        // update the metrics.
        if clsutils.IsAdaptiveServiceFailed(result.Error()) {

Review Comment:
   If the two test branches have the same logic, I think you should merge them.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org

Reply via email to