You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/02/19 09:01:36 UTC

[GitHub] [skywalking] mrproliu commented on a change in pull request #6398: Meter system enhancement

mrproliu commented on a change in pull request #6398:
URL: https://github.com/apache/skywalking/pull/6398#discussion_r579027530



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/meter/MeterSystem.java
##########
@@ -187,6 +187,21 @@ public MeterSystem(final ModuleManager manager) {
             throw new IllegalArgumentException("Function " + functionName + " can't be found by javaassist.");
         }
         final String className = formatName(metricsName);
+
+        /**
+         * Check whether the metrics class is already defined or not
+         */
+        try {
+            CtClass alreadyMetric = classPool.get(METER_CLASS_PACKAGE + className);
+            if (alreadyMetric.getSuperclass() != parentClass || type != meterPrototypes.get(metricsName).getScopeType()) {

Review comment:
       Their data type is `Class`, I think we don't need to the use `equals` method? 




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

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