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 08:55:45 UTC

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

wu-sheng commented on a change in pull request #6398:
URL: https://github.com/apache/skywalking/pull/6398#discussion_r579023850



##########
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:
       `!=` -> `equals`?




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