You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/09/23 08:15:11 UTC

[GitHub] [dubbo] CrazyHZM commented on a change in pull request #8785: [3.0] Refactor MetricsConfig

CrazyHZM commented on a change in pull request #8785:
URL: https://github.com/apache/dubbo/pull/8785#discussion_r714560912



##########
File path: dubbo-common/src/main/java/org/apache/dubbo/common/utils/MethodUtils.java
##########
@@ -395,4 +396,35 @@ static Method findOverriddenMethod(Method overrider, Class<?> declaringClass) {
         List<Method> matchedMethods = getAllMethods(declaringClass, method -> overrides(overrider, method));
         return matchedMethods.isEmpty() ? null : matchedMethods.get(0);
     }
+
+    /**
+     * Extract fieldName from set/get/is method. if it's not a set/get/is method, return empty string.
+     * If method equals get/is/getClass/getObject, also return empty string.
+     *
+     * @param method method
+     * @return fieldName
+     */
+    static String extractFieldName(Method method) {

Review comment:
       Missing unit test, same below.
   
   

##########
File path: dubbo-common/src/test/java/org/apache/dubbo/config/context/ConfigManagerTest.java
##########
@@ -126,6 +126,7 @@ public void tesModuleConfig() {
     @Test
     public void tesMetricsConfig() {
         MetricsConfig config = new MetricsConfig();
+        config.setProtocol("prometheus");

Review comment:
       Replace with `PROTOCOL_PROMETHEUS`.
   Same below.




-- 
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-unsubscribe@dubbo.apache.org

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



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