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 2022/10/19 08:02:58 UTC

[GitHub] [skywalking] pg-yang opened a new pull request, #9813: labeled avg

pg-yang opened a new pull request, #9813:
URL: https://github.com/apache/skywalking/pull/9813

   <!--
       ⚠️ 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 πŸ‘† ==== -->
   
   - [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>.
   - [ ] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/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] wu-sheng commented on a diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999092363


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/OALRuntime.java:
##########
@@ -421,13 +421,13 @@ private Class generateDispatcherClass(String scopeName,
                         )
                     }
                 );
-
             dispatcherClass.setGenericSignature(dispatcherSignature.encode());
         } catch (NotFoundException e) {
             log.error("Can't find Dispatcher interface for " + className + ".", e);
             throw new OALCompileException(e.getMessage(), e);
         }
 
+

Review Comment:
   This should be reverted.



-- 
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] pg-yang closed pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
pg-yang closed pull request #9813: labeled avg in OAL
URL: https://github.com/apache/skywalking/pull/9813


-- 
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 diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999093199


##########
oap-server/oal-grammar/src/main/antlr4/org/apache/skywalking/oal/rt/grammar/OALParser.g4:
##########
@@ -87,7 +87,9 @@ functionName
 funcParamExpression
     : expression
     ;
-
+arrayFuncParamExpression
+    : LS_BRACKET ((funcParamExpression|literalExpression|attributeExpression) (COMMA (funcParamExpression|literalExpression|attributeExpression))*) RS_BRACKET

Review Comment:
   The element of an array could be `funcParamExpression`? Could you demo how it would be?



-- 
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] pg-yang commented on a diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
pg-yang commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999097080


##########
oap-server/oal-grammar/src/main/antlr4/org/apache/skywalking/oal/rt/grammar/OALParser.g4:
##########
@@ -87,7 +87,9 @@ functionName
 funcParamExpression
     : expression
     ;
-
+arrayFuncParamExpression
+    : LS_BRACKET ((funcParamExpression|literalExpression|attributeExpression) (COMMA (funcParamExpression|literalExpression|attributeExpression))*) RS_BRACKET

Review Comment:
   ```
   mq_transmission_latency = from(MessageQueueAccess.transmissionLatency).filter(operation == MessageQueueOperation.Consume).labeledLongAvg([topic,queue,queue,"1"]);
   
   ```
   
   Like  this , we  could  use  `[a]` to represent an arg 



-- 
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] pg-yang commented on a diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
pg-yang commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999160001


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/AggregationFuncStmt.java:
##########
@@ -49,22 +50,23 @@ public ConditionExpression getNextFuncConditionExpression() {
         return funcConditionExpressions.get(funcConditionExpressionGetIdx++);
     }
 
-    public void addFuncArg(Argument argument) {
+    public void addFuncArg(Argument... argument) {

Review Comment:
   >  you still don't have funcParamExpression
   
   Yes , I would  confirm it .
   
   > About the array type
   
   Actually , I want to build the type of array  based on the parameter type , which will support base-type , such as  StringArray  , intArray,doubleArray, 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] pg-yang commented on a diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
pg-yang commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999097080


##########
oap-server/oal-grammar/src/main/antlr4/org/apache/skywalking/oal/rt/grammar/OALParser.g4:
##########
@@ -87,7 +87,9 @@ functionName
 funcParamExpression
     : expression
     ;
-
+arrayFuncParamExpression
+    : LS_BRACKET ((funcParamExpression|literalExpression|attributeExpression) (COMMA (funcParamExpression|literalExpression|attributeExpression))*) RS_BRACKET

Review Comment:
   ```
   mq_transmission_latency = from(MessageQueueAccess.transmissionLatency).filter(operation == MessageQueueOperation.Consume).labeledLongAvg([topic,queue,queue,"1"]);
   
   ```
   
   Like  this , we  could  use  `[a]` to represent an array  arg 



-- 
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 diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999091373


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/DeepAnalysis.java:
##########
@@ -37,7 +37,8 @@
 public class DeepAnalysis {
     public AnalysisResult analysis(AnalysisResult result) {
         // 1. Set sub package name by source.metrics
-        Class<? extends Metrics> metricsClass = MetricsHolder.find(result.getAggregationFuncStmt().getAggregationFunctionName());
+        Class<? extends Metrics> metricsClass = MetricsHolder.find(
+            result.getAggregationFuncStmt().getAggregationFunctionName());

Review Comment:
   I think this is only a format change? And should be reverted 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] pg-yang commented on a diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
pg-yang commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999099741


##########
oap-server/oal-grammar/src/main/antlr4/org/apache/skywalking/oal/rt/grammar/OALParser.g4:
##########
@@ -87,7 +87,9 @@ functionName
 funcParamExpression
     : expression
     ;
-
+arrayFuncParamExpression
+    : LS_BRACKET ((funcParamExpression|literalExpression|attributeExpression) (COMMA (funcParamExpression|literalExpression|attributeExpression))*) RS_BRACKET

Review Comment:
   The  according metrics  class  Entrance 
   ```
   @Entrance
       public final void combine(@SourceFrom long value, @ConstOne long count, @Arg String[] labels)
   ```



-- 
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] pg-yang commented on a diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
pg-yang commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999099741


##########
oap-server/oal-grammar/src/main/antlr4/org/apache/skywalking/oal/rt/grammar/OALParser.g4:
##########
@@ -87,7 +87,9 @@ functionName
 funcParamExpression
     : expression
     ;
-
+arrayFuncParamExpression
+    : LS_BRACKET ((funcParamExpression|literalExpression|attributeExpression) (COMMA (funcParamExpression|literalExpression|attributeExpression))*) RS_BRACKET

Review Comment:
   ```
   @Entrance
       public final void combine(@SourceFrom long value, @ConstOne long count, @Arg String[] labels)
   ```



-- 
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 diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999126350


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/AggregationFuncStmt.java:
##########
@@ -49,22 +50,23 @@ public ConditionExpression getNextFuncConditionExpression() {
         return funcConditionExpressions.get(funcConditionExpressionGetIdx++);
     }
 
-    public void addFuncArg(Argument argument) {
+    public void addFuncArg(Argument... argument) {

Review Comment:
   Please explain this `topic,queue,queue,"1"` first. Is this meaning, first three elements of the array are from source attributes, and the last is a literal string?



-- 
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 diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999125061


##########
oap-server/oal-grammar/src/main/antlr4/org/apache/skywalking/oal/rt/grammar/OALParser.g4:
##########
@@ -87,7 +87,9 @@ functionName
 funcParamExpression
     : expression
     ;
-
+arrayFuncParamExpression
+    : LS_BRACKET ((funcParamExpression|literalExpression|attributeExpression) (COMMA (funcParamExpression|literalExpression|attributeExpression))*) RS_BRACKET

Review Comment:
   My question is about `funcParamExpression`, what you mentioned is `attributeExpression`(topic,queue,queue).



-- 
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 diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999213407


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/AggregationFuncStmt.java:
##########
@@ -49,22 +50,23 @@ public ConditionExpression getNextFuncConditionExpression() {
         return funcConditionExpressions.get(funcConditionExpressionGetIdx++);
     }
 
-    public void addFuncArg(Argument argument) {
+    public void addFuncArg(Argument... argument) {

Review Comment:
   I commented another concern https://github.com/apache/skywalking/issues/9676#issuecomment-1283735427 about the original proposal.



-- 
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] pg-yang commented on a diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
pg-yang commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999095029


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/OALRuntime.java:
##########
@@ -421,13 +421,13 @@ private Class generateDispatcherClass(String scopeName,
                         )
                     }
                 );
-
             dispatcherClass.setGenericSignature(dispatcherSignature.encode());
         } catch (NotFoundException e) {
             log.error("Can't find Dispatcher interface for " + className + ".", e);
             throw new OALCompileException(e.getMessage(), e);
         }
 
+

Review Comment:
   Sorry , This PR  just for preview or  discussion  . You could ignore it  



-- 
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] pg-yang commented on a diff in pull request #9813: labeled avg

Posted by GitBox <gi...@apache.org>.
pg-yang commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999084056


##########
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/LabeledLongAvgMetrics.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * 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;
+
+import java.util.Arrays;
+import java.util.Objects;
+import java.util.Set;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.Arg;
+import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.ConstOne;
+import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.Entrance;
+import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.MetricsFunction;
+import org.apache.skywalking.oap.server.core.analysis.metrics.annotation.SourceFrom;
+import org.apache.skywalking.oap.server.core.storage.annotation.Column;
+import org.apache.skywalking.oap.server.core.storage.annotation.ElasticSearch;
+
+@MetricsFunction(functionName = "labeledLongAvg")
+public abstract class LabeledLongAvgMetrics extends Metrics implements LabeledValueHolder {
+
+    protected static final String SUMMATION = "summation";
+    protected static final String COUNT = "count";
+    protected static final String VALUE = "value";
+
+    @Getter
+    @Setter
+    @Column(columnName = SUMMATION, storageOnly = true)
+    @ElasticSearch.Column(columnAlias = "datatable_summation")
+    protected DataTable summation = new DataTable(30);
+
+    @Getter
+    @Setter
+    @Column(columnName = COUNT, storageOnly = true)
+    @ElasticSearch.Column(columnAlias = "datatable_count")
+    protected DataTable count = new DataTable(30);
+    @Getter
+    @Setter
+    @Column(columnName = VALUE, dataType = Column.ValueDataType.LABELED_VALUE, storageOnly = true)
+    @ElasticSearch.Column(columnAlias = "datatable_value")
+    private DataTable value = new DataTable(30);
+
+    @Entrance
+    public final void combine(@SourceFrom long value, @ConstOne long count, @Arg String[] labels) {

Review Comment:
   Entrance  



-- 
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] pg-yang commented on a diff in pull request #9813: labeled avg

Posted by GitBox <gi...@apache.org>.
pg-yang commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999082263


##########
oap-server/oal-grammar/src/main/antlr4/org/apache/skywalking/oal/rt/grammar/OALParser.g4:
##########
@@ -87,7 +87,9 @@ functionName
 funcParamExpression
     : expression
     ;
-
+arrayFuncParamExpression
+    : LS_BRACKET ((funcParamExpression|literalExpression|attributeExpression) (COMMA (funcParamExpression|literalExpression|attributeExpression))*) RS_BRACKET

Review Comment:
   Support array argument  , such as  `labeledLongAvg([topic,queue,queue,"1"]);`



-- 
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 diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999140682


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/AggregationFuncStmt.java:
##########
@@ -49,22 +50,23 @@ public ConditionExpression getNextFuncConditionExpression() {
         return funcConditionExpressions.get(funcConditionExpressionGetIdx++);
     }
 
-    public void addFuncArg(Argument argument) {
+    public void addFuncArg(Argument... argument) {

Review Comment:
   Then, you still don't have funcParamExpression. Could you confirm whether you need this?
   
   About the array type, do we need to make it type-sensitive? Such as building StringArray, rather than a general Array?



-- 
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] pg-yang commented on a diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
pg-yang commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999130363


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/AggregationFuncStmt.java:
##########
@@ -49,22 +50,23 @@ public ConditionExpression getNextFuncConditionExpression() {
         return funcConditionExpressions.get(funcConditionExpressionGetIdx++);
     }
 
-    public void addFuncArg(Argument argument) {
+    public void addFuncArg(Argument... argument) {

Review Comment:
   queue , topic is from  source  attributes , and  "1" is demo  just  for demonstrating  literal string  
   



-- 
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] sonatype-lift[bot] commented on pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
sonatype-lift[bot] commented on PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#issuecomment-1283640114

   :warning: **6 God Classes** were detected by Lift in this project. [Visit the Lift web console](https://lift.sonatype.com/results/github.com/apache/skywalking/01GFQM8QQ3TRJ7KGPHE7383NAV?tab=technical-debt&utm_source=github.com&utm_campaign=lift-comment&utm_content=apache\%20skywalking) for more details.


-- 
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 diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999090982


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/DeepAnalysis.java:
##########
@@ -81,9 +82,10 @@ public AnalysisResult analysis(AnalysisResult result) {
         EntryMethod entryMethod = new EntryMethod();
         result.setEntryMethod(entryMethod);
         entryMethod.setMethodName(entranceMethod.getName());
-
+        final Parameter[] parameters = entranceMethod.getParameters();
         // 4. Use parameter's annotation of entrance method to generate aggregation entrance.
-        for (Parameter parameter : entranceMethod.getParameters()) {
+        for (int i = 0; i < parameters.length; i++) {
+            Parameter parameter = parameters[i];

Review Comment:
   Why change this?



-- 
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 diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999094905


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/AggregationFuncStmt.java:
##########
@@ -49,22 +50,23 @@ public ConditionExpression getNextFuncConditionExpression() {
         return funcConditionExpressions.get(funcConditionExpressionGetIdx++);
     }
 
-    public void addFuncArg(Argument argument) {
+    public void addFuncArg(Argument... argument) {

Review Comment:
   An argument is an Argument Array. I think this is wrong from grammar level. We should discuss how to host an Array inside the `Argument`, or create a sub-type of `Argument`, or create an interface with two implementations??



-- 
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] pg-yang commented on a diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
pg-yang commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999103665


##########
oap-server/oal-grammar/src/main/antlr4/org/apache/skywalking/oal/rt/grammar/OALParser.g4:
##########
@@ -87,7 +87,9 @@ functionName
 funcParamExpression
     : expression
     ;
-
+arrayFuncParamExpression
+    : LS_BRACKET ((funcParamExpression|literalExpression|attributeExpression) (COMMA (funcParamExpression|literalExpression|attributeExpression))*) RS_BRACKET

Review Comment:
   I  recked `funcParamExpression ` , you  are right  . I should  remove  `funcParamExpression `



-- 
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 diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999192153


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/AggregationFuncStmt.java:
##########
@@ -49,22 +50,23 @@ public ConditionExpression getNextFuncConditionExpression() {
         return funcConditionExpressions.get(funcConditionExpressionGetIdx++);
     }
 
-    public void addFuncArg(Argument argument) {
+    public void addFuncArg(Argument... argument) {

Review Comment:
   But, there is an issue about this. `SourceFrom` should be for `getting field value from a source's attribute`, and `Arg` should be a kind of literal declared from the OAL.
   
   Now, my question would be, can't we build a field in the source including key-value pairs directly? And use `SourceFrom` rather than adding this complexity for the OAL? We are not really building an array mixed with attribute values and literal strings, right?



-- 
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] pg-yang commented on a diff in pull request #9813: labeled avg

Posted by GitBox <gi...@apache.org>.
pg-yang commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999083269


##########
oap-server/server-starter/src/main/resources/oal/core.oal:
##########
@@ -15,74 +15,4 @@
  * limitations under the License.
  *
  */
-
-// For services using protocols HTTP 1/2, gRPC, RPC, etc., the cpm metrics means "calls per minute",
-// for services that are built on top of TCP, the cpm means "packages per minute".
-
-// Service scope metrics
-service_resp_time = from(Service.latency).longAvg();
-service_sla = from(Service.*).percent(status == true);
-service_cpm = from(Service.*).cpm();
-service_percentile = from(Service.latency).percentile(10); // Multiple values including p50, p75, p90, p95, p99
-service_apdex = from(Service.latency).apdex(name, status);
-service_mq_consume_count = from(Service.*).filter(type == RequestType.MQ).count();
-service_mq_consume_latency = from((str->long)Service.tag["transmission.latency"]).filter(type == RequestType.MQ).filter(tag["transmission.latency"] != null).longAvg();
-
-// Service relation scope metrics for topology
-service_relation_client_cpm = from(ServiceRelation.*).filter(detectPoint == DetectPoint.CLIENT).cpm();
-service_relation_server_cpm = from(ServiceRelation.*).filter(detectPoint == DetectPoint.SERVER).cpm();
-service_relation_client_call_sla = from(ServiceRelation.*).filter(detectPoint == DetectPoint.CLIENT).percent(status == true);
-service_relation_server_call_sla = from(ServiceRelation.*).filter(detectPoint == DetectPoint.SERVER).percent(status == true);
-service_relation_client_resp_time = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.CLIENT).longAvg();
-service_relation_server_resp_time = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.SERVER).longAvg();
-service_relation_client_percentile = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.CLIENT).percentile(10); // Multiple values including p50, p75, p90, p95, p99
-service_relation_server_percentile = from(ServiceRelation.latency).filter(detectPoint == DetectPoint.SERVER).percentile(10); // Multiple values including p50, p75, p90, p95, p99
-
-// Service Instance relation scope metrics for topology
-service_instance_relation_client_cpm = from(ServiceInstanceRelation.*).filter(detectPoint == DetectPoint.CLIENT).cpm();
-service_instance_relation_server_cpm = from(ServiceInstanceRelation.*).filter(detectPoint == DetectPoint.SERVER).cpm();
-service_instance_relation_client_call_sla = from(ServiceInstanceRelation.*).filter(detectPoint == DetectPoint.CLIENT).percent(status == true);
-service_instance_relation_server_call_sla = from(ServiceInstanceRelation.*).filter(detectPoint == DetectPoint.SERVER).percent(status == true);
-service_instance_relation_client_resp_time = from(ServiceInstanceRelation.latency).filter(detectPoint == DetectPoint.CLIENT).longAvg();
-service_instance_relation_server_resp_time = from(ServiceInstanceRelation.latency).filter(detectPoint == DetectPoint.SERVER).longAvg();
-service_instance_relation_client_percentile = from(ServiceInstanceRelation.latency).filter(detectPoint == DetectPoint.CLIENT).percentile(10); // Multiple values including p50, p75, p90, p95, p99
-service_instance_relation_server_percentile = from(ServiceInstanceRelation.latency).filter(detectPoint == DetectPoint.SERVER).percentile(10); // Multiple values including p50, p75, p90, p95, p99
-
-// Service Instance Scope metrics
-service_instance_sla = from(ServiceInstance.*).percent(status == true);
-service_instance_resp_time= from(ServiceInstance.latency).longAvg();
-service_instance_cpm = from(ServiceInstance.*).cpm();
-
-// Endpoint scope metrics
-endpoint_cpm = from(Endpoint.*).cpm();
-endpoint_resp_time = from(Endpoint.latency).longAvg();
-endpoint_sla = from(Endpoint.*).percent(status == true);
-endpoint_percentile = from(Endpoint.latency).percentile(10); // Multiple values including p50, p75, p90, p95, p99
-endpoint_mq_consume_count = from(Endpoint.*).filter(type == RequestType.MQ).count();
-endpoint_mq_consume_latency = from((str->long)Endpoint.tag["transmission.latency"]).filter(type == RequestType.MQ).filter(tag["transmission.latency"] != null).longAvg();
-
-// Endpoint relation scope metrics
-endpoint_relation_cpm = from(EndpointRelation.*).filter(detectPoint == DetectPoint.SERVER).cpm();
-endpoint_relation_resp_time = from(EndpointRelation.rpcLatency).filter(detectPoint == DetectPoint.SERVER).longAvg();
-endpoint_relation_sla = from(EndpointRelation.*).filter(detectPoint == DetectPoint.SERVER).percent(status == true);
-endpoint_relation_percentile = from(EndpointRelation.rpcLatency).filter(detectPoint == DetectPoint.SERVER).percentile(10); // Multiple values including p50, p75, p90, p95, p99
-
-database_access_resp_time = from(DatabaseAccess.latency).longAvg();
-database_access_sla = from(DatabaseAccess.*).percent(status == true);
-database_access_cpm = from(DatabaseAccess.*).cpm();
-database_access_percentile = from(DatabaseAccess.latency).percentile(10);
-
-cache_read_resp_time = from(CacheAccess.latency).filter(operation == VirtualCacheOperation.Read).longAvg();
-cache_read_sla = from(CacheAccess.*).filter(operation == VirtualCacheOperation.Read).percent(status == true);
-cache_read_cpm = from(CacheAccess.*).filter(operation == VirtualCacheOperation.Read).cpm();
-cache_read_percentile = from(CacheAccess.latency).filter(operation == VirtualCacheOperation.Read).percentile(10);
-
-cache_write_resp_time = from(CacheAccess.latency).filter(operation == VirtualCacheOperation.Write).longAvg();
-cache_write_sla = from(CacheAccess.*).filter(operation == VirtualCacheOperation.Write).percent(status == true);
-cache_write_cpm = from(CacheAccess.*).filter(operation == VirtualCacheOperation.Write).cpm();
-cache_write_percentile = from(CacheAccess.latency).filter(operation == VirtualCacheOperation.Write).percentile(10);
-
-cache_access_resp_time = from(CacheAccess.latency).longAvg();
-cache_access_sla = from(CacheAccess.*).percent(status == true);
-cache_access_cpm = from(CacheAccess.*).cpm();
-cache_access_percentile = from(CacheAccess.latency).percentile(10);
\ No newline at end of file
+mq_transmission_latency = from(MessageQueueAccess.transmissionLatency).filter(operation == MessageQueueOperation.Consume).labeledLongAvg([topic,queue,queue,"1"]);

Review Comment:
   The  demo  labeled avg  metrics 



-- 
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] pg-yang commented on a diff in pull request #9813: labeled avg in OAL

Posted by GitBox <gi...@apache.org>.
pg-yang commented on code in PR #9813:
URL: https://github.com/apache/skywalking/pull/9813#discussion_r999111582


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/parser/AggregationFuncStmt.java:
##########
@@ -49,22 +50,23 @@ public ConditionExpression getNextFuncConditionExpression() {
         return funcConditionExpressions.get(funcConditionExpressionGetIdx++);
     }
 
-    public void addFuncArg(Argument argument) {
+    public void addFuncArg(Argument... argument) {

Review Comment:
   Yes ,  Do you  agree  with adding `arrayFuncParamExpression `  to `grammar` ?
   The  demo  such as 
   ```
   mq_transmission_latency = from(MessageQueueAccess.transmissionLatency).filter(operation == MessageQueueOperation.Consume).labeledLongAvg([topic,queue,queue,"1"]);
   
   ```
   Let's  talk  all here  . 
   



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