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/09/02 02:11:41 UTC

[GitHub] [skywalking] YczYanchengzhe opened a new pull request #7636: Support for filter filtering of int type values

YczYanchengzhe opened a new pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636


   <!--
       ⚠️ Please make sure to read this template first, pull requests that don't accord with this template
       maybe closed without notice.
       Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
       Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
   -->
   
   <!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
   ### Fix <bug description or the bug issue number or bug issue link>
   - [ ] Add a unit test to verify that the fix works.
   - [ ] Explain briefly why the bug exists and how to fix it.
        ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
   
   <!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
   ### Improve the performance of <class or module or ...>
   - [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking/blob/master/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
   - [ ] The benchmark result.
   ```text
   <Paste the benchmark results here>
   ```
   - [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
        ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
   
   <!-- ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👇 ====
   ### <Feature description>
   - [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
   - [ ] Update the documentation to include this new feature.
   - [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
   - [ ] If it's UI related, attach the screenshots below.
        ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
   
   - [x] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #7521.
   - [ ] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/CHANGES.md).
   


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

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



[GitHub] [skywalking] YczYanchengzhe commented on pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
YczYanchengzhe commented on pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#issuecomment-911826012


   Thank you so much for your help, I learned a lot of interesting things, I look to see what more ~ than I can do


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

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



[GitHub] [skywalking] YczYanchengzhe commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
YczYanchengzhe commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701087005



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/IntMatch.java
##########
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.metrics.expression;
+
+import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.FilterMatcher;
+
+@FilterMatcher
+public class IntMatch {
+
+    public boolean match(int left, int right) {
+        return left == right;
+    }
+
+    public boolean match(Integer left, Integer right) {

Review comment:
       ![image](https://user-images.githubusercontent.com/45945752/131852708-7fd9cce2-a22e-4349-b733-035c5073622a.png)
   The problem is the automatic binning, which is fine under my test




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

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



[GitHub] [skywalking] YczYanchengzhe commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
YczYanchengzhe commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701199838



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/NumberMatch.java
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.metrics.expression;
+
+import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.FilterMatcher;
+
+@FilterMatcher
+public class NumberMatch {
+
+    public boolean match(int left, int right) {
+        return left == right;
+    }
+
+    public boolean match(long left, long right) {
+        return left == right;
+    }
+
+    public boolean match(float left, float right) {
+        return left == right;
+    }
+
+    public boolean match(Number left, Number right) {
+        return left.equals(right);
+    }

Review comment:
       I agree 




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

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



[GitHub] [skywalking] wu-sheng commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701063443



##########
File path: oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/StringMatchTest.java
##########
@@ -23,44 +23,44 @@
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-public class EqualMatchTest {
+public class StringMatchTest {
 
     @Test
     public void integerShouldEqualWhenLargerThan128() {
         Integer a = 334;
         Integer b = 334;
-        boolean match = new EqualMatch().match(a, b);

Review comment:
       Same reason as https://github.com/apache/skywalking/pull/7636#discussion_r701062504. And discussed at https://github.com/apache/skywalking/discussions/7517




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

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



[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701198648



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/NumberMatch.java
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.metrics.expression;
+
+import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.FilterMatcher;
+
+@FilterMatcher
+public class NumberMatch {
+
+    public boolean match(int left, int right) {
+        return left == right;
+    }
+
+    public boolean match(long left, long right) {
+        return left == right;
+    }
+
+    public boolean match(float left, float right) {
+        return left == right;
+    }
+
+    public boolean match(Number left, Number right) {
+        return left.equals(right);
+    }

Review comment:
       @YczYanchengzhe I think supporting `long / Long`, `int / Integer` should be enough in our cases, we only have 1 `double` typed field in `Source` scope and its name is `usePercent`, I don't think it makes sense to compare `==` between `double`s




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

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



[GitHub] [skywalking] wu-sheng commented on pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#issuecomment-911458352


   > Already for merge
   
   You should fix CI. Then we will do the review.


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

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



[GitHub] [skywalking] wu-sheng commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701187522



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/NumberMatch.java
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.metrics.expression;
+
+import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.FilterMatcher;
+
+@FilterMatcher
+public class NumberMatch {
+
+    public boolean match(int left, int right) {
+        return left == right;
+    }
+
+    public boolean match(long left, long right) {
+        return left == right;
+    }
+
+    public boolean match(float left, float right) {
+        return left == right;
+    }
+
+    public boolean match(Number left, Number right) {
+        return left.equals(right);
+    }

Review comment:
       ```suggestion
   ```
   
   Number doesn't include float like I mentioned.
   ```
   numberConditionValue
       : NUMBER_LITERAL
       ;
   
   NUMBER_LITERAL :   Digits+;
   
   fragment Digits
       : [0-9] ([0-9_]* [0-9])?
       ;
   ```
   
   And Number object doesn't make sense too.




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

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



[GitHub] [skywalking] YczYanchengzhe commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
YczYanchengzhe commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701064993



##########
File path: oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/StringMatchTest.java
##########
@@ -23,44 +23,44 @@
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-public class EqualMatchTest {
+public class StringMatchTest {
 
     @Test
     public void integerShouldEqualWhenLargerThan128() {
         Integer a = 334;
         Integer b = 334;
-        boolean match = new EqualMatch().match(a, b);

Review comment:
       Am I trying below whether adding the method signature can be directly supported




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

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



[GitHub] [skywalking] wu-sheng commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701117112



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/IntMatch.java
##########
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.metrics.expression;
+
+import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.FilterMatcher;
+
+@FilterMatcher
+public class IntMatch {
+
+    public boolean match(int left, int right) {
+        return left == right;
+    }
+
+    public boolean match(Integer left, Integer right) {

Review comment:
       My point is NumberEqual and IntEqual both make sense and clear. You could add `match(long left, long right` in case for the future. `StringMatch` should be kept in String only.




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

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



[GitHub] [skywalking] wu-sheng commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701062504



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/IntMatch.java
##########
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.metrics.expression;
+
+import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.FilterMatcher;
+
+@FilterMatcher
+public class IntMatch {

Review comment:
       I think this is not working. Actually from my understanding, only `int left, int right` works. Because auto boxing/unboxing is compiling level, which is not available in javaassist compiler.




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

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



[GitHub] [skywalking] YczYanchengzhe commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
YczYanchengzhe commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701074328



##########
File path: oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/StringMatchTest.java
##########
@@ -23,44 +23,44 @@
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-public class EqualMatchTest {
+public class StringMatchTest {
 
     @Test
     public void integerShouldEqualWhenLargerThan128() {
         Integer a = 334;
         Integer b = 334;
-        boolean match = new EqualMatch().match(a, b);

Review comment:
       For this problem kezhenxu94 raised a better solution I m trying




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

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



[GitHub] [skywalking] wu-sheng commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701115884



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/IntMatch.java
##########
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.metrics.expression;
+
+import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.FilterMatcher;
+
+@FilterMatcher
+public class IntMatch {
+
+    public boolean match(int left, int right) {
+        return left == right;
+    }
+
+    public boolean match(Integer left, Integer right) {

Review comment:
       This could work, but it still requires you to change g4 file, because it was `stringMatch`, which doesn't fit the case.




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

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



[GitHub] [skywalking] wu-sheng commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701084779



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/IntMatch.java
##########
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.metrics.expression;
+
+import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.FilterMatcher;
+
+@FilterMatcher
+public class IntMatch {
+
+    public boolean match(int left, int right) {
+        return left == right;
+    }
+
+    public boolean match(Integer left, Integer right) {

Review comment:
       My point is this is not working. Consider to remove this and run test.




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

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



[GitHub] [skywalking] wu-sheng commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701097360



##########
File path: oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/StringMatchTest.java
##########
@@ -23,44 +23,44 @@
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-public class EqualMatchTest {
+public class StringMatchTest {
 
     @Test
     public void integerShouldEqualWhenLargerThan128() {
         Integer a = 334;
         Integer b = 334;
-        boolean match = new EqualMatch().match(a, b);

Review comment:
       whether it is working or not, is not important at all. If you want to more method, consider int and long. But you would not compare number, especially double and float. Because simply in Java `1.01 == 1.01` is not guaranteed. 




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

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



[GitHub] [skywalking] kezhenxu94 merged pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
kezhenxu94 merged pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636


   


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

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



[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701056881



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/IntMatch.java
##########
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.metrics.expression;
+
+import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.FilterMatcher;
+
+@FilterMatcher
+public class IntMatch {

Review comment:
       Can we use `match(Number left, Number right)` so that they apply to other primitives like long, double, etc.




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

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



[GitHub] [skywalking] YczYanchengzhe commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
YczYanchengzhe commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701065963



##########
File path: oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/StringMatchTest.java
##########
@@ -23,44 +23,44 @@
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-public class EqualMatchTest {
+public class StringMatchTest {
 
     @Test
     public void integerShouldEqualWhenLargerThan128() {
         Integer a = 334;
         Integer b = 334;
-        boolean match = new EqualMatch().match(a, b);

Review comment:
       There is a question about what the regression tests need to do every time you modify the oap part of the code




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

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



[GitHub] [skywalking] wu-sheng commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701069000



##########
File path: oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/StringMatchTest.java
##########
@@ -23,44 +23,44 @@
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-public class EqualMatchTest {
+public class StringMatchTest {
 
     @Test
     public void integerShouldEqualWhenLargerThan128() {
         Integer a = 334;
         Integer b = 334;
-        boolean match = new EqualMatch().match(a, b);

Review comment:
       > Am I trying below whether adding the method signature can be directly supported
   
   What is this? A question or something?
   
   > There is a question about what the regression tests need to do every time you modify the oap part of the code
   
   There is no guidance or standards about this, because this is rarely to change, and has been changed for a long time.




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

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



[GitHub] [skywalking] YczYanchengzhe commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
YczYanchengzhe commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701077898



##########
File path: oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/StringMatchTest.java
##########
@@ -23,44 +23,44 @@
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-public class EqualMatchTest {
+public class StringMatchTest {
 
     @Test
     public void integerShouldEqualWhenLargerThan128() {
         Integer a = 334;
         Integer b = 334;
-        boolean match = new EqualMatch().match(a, b);

Review comment:
       ![image](https://user-images.githubusercontent.com/45945752/131850965-c22bfa4f-2237-436e-b366-9b3313e98059.png)
   As kezhenxu94 said this can be solved by simply the matching rules support numbers in stringmatch I think this is a better solution and is the class name restored to EqualMatch, I think EqualMatch is more reasonable in design and functionality




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

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



[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#discussion_r701058604



##########
File path: oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/analysis/metrics/expression/StringMatchTest.java
##########
@@ -23,44 +23,44 @@
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-public class EqualMatchTest {
+public class StringMatchTest {
 
     @Test
     public void integerShouldEqualWhenLargerThan128() {
         Integer a = 334;
         Integer b = 334;
-        boolean match = new EqualMatch().match(a, b);

Review comment:
       From these tests, the original marcher should already support numeric types, just need to wrap primitives such as `int` to boxed type `Integrr` or add method signatures with primitive types 




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

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



[GitHub] [skywalking] YczYanchengzhe commented on pull request #7636: Support for filter filtering of int type values

Posted by GitBox <gi...@apache.org>.
YczYanchengzhe commented on pull request #7636:
URL: https://github.com/apache/skywalking/pull/7636#issuecomment-911420340


   Already for merge


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

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