You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "songxiaosheng (via GitHub)" <gi...@apache.org> on 2023/04/18 01:01:01 UTC

[GitHub] [dubbo] songxiaosheng commented on a diff in pull request #12096: Configuration center metrics separate module

songxiaosheng commented on code in PR #12096:
URL: https://github.com/apache/dubbo/pull/12096#discussion_r1169388626


##########
dubbo-configcenter/dubbo-configcenter-nacos/src/main/java/org/apache/dubbo/configcenter/support/nacos/NacosDynamicConfiguration.java:
##########
@@ -345,9 +346,8 @@ public void innerReceive(String dataId, String group, String configInfo) {
             }
             listeners.forEach(listener -> listener.process(event));
 
-            ConfigCenterMetricsCollector collector =
-                applicationModel.getBeanFactory().getOrRegisterBean(ConfigCenterMetricsCollector.class);
-            collector.increaseUpdated("nacos", applicationModel.getApplicationName(), event);
+            MetricsEventBus.publish(ConfigCenterEvent.toChangeEvent(applicationModel, event.getKey(), event.getGroup(),
+                "nacos", ConfigChangeType.ADDED.name(), SELF_INCREMENT_SIZE));

Review Comment:
   Can **“nacos”** be modified to a constant



##########
dubbo-configcenter/dubbo-configcenter-zookeeper/src/main/java/org/apache/dubbo/configcenter/support/zookeeper/ZookeeperDataListener.java:
##########
@@ -77,9 +80,8 @@ public void dataChanged(String path, Object value, EventType eventType) {
             listeners.forEach(listener -> listener.process(configChangeEvent));
         }
 
-        ConfigCenterMetricsCollector collector =
-            applicationModel.getBeanFactory().getBean(ConfigCenterMetricsCollector.class);
-        collector.increaseUpdated("zookeeper", applicationModel.getApplicationName(), configChangeEvent);
+        MetricsEventBus.publish(ConfigCenterEvent.toChangeEvent(applicationModel, configChangeEvent.getKey(), configChangeEvent.getGroup(),
+            "zookeeper", ConfigChangeType.ADDED.name(), SELF_INCREMENT_SIZE));

Review Comment:
   Can “zookeeper” be modified to a constant



-- 
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