kezhenxu94 commented on code in PR #11194:
URL: https://github.com/apache/skywalking/pull/11194#discussion_r1287282116


##########
docs/en/api/metrics-query-expression.md:
##########
@@ -206,3 +206,22 @@ aggregate_labels(total_commands_rate, SUM)
 
 ### Result Type
 The ExpressionResultType of the aggregateLabels operation is 
TIME_SERIES_VALUES.
+
+## ViewAsSequence Operation
+ViewAsSequence operation searches for expressions in the given list from start 
to end and returns the expression that not empty.
+
+Expression:
+```text
+view_as_seq([<expression_1>, <expression_2>, ...])
+```
+
+For example:
+if the first expression value is empty but the second one not empty, it would 
return the result from the second expression. 
+The following example would return the content of the **service_sla** metric.
+
+```text
+view_as_seq(not_existing, service_cpm)

Review Comment:
   Why is `service_sla` returned when it doesn't appear in the expression at 
all? Is it a typo?



##########
docs/en/api/metrics-query-expression.md:
##########
@@ -206,3 +206,22 @@ aggregate_labels(total_commands_rate, SUM)
 
 ### Result Type
 The ExpressionResultType of the aggregateLabels operation is 
TIME_SERIES_VALUES.
+
+## ViewAsSequence Operation
+ViewAsSequence operation searches for expressions in the given list from start 
to end and returns the expression that not empty.

Review Comment:
   It's better also to document this is short-circuit, i.e., the result is 
returned as soon as the first non empty expression is found and the remaining 
expressions will not be evaluated



##########
docs/en/api/metrics-query-expression.md:
##########
@@ -206,3 +206,22 @@ aggregate_labels(total_commands_rate, SUM)
 
 ### Result Type
 The ExpressionResultType of the aggregateLabels operation is 
TIME_SERIES_VALUES.
+
+## ViewAsSequence Operation
+ViewAsSequence operation searches for expressions in the given list from start 
to end and returns the expression that not empty.

Review Comment:
   I'm curious what does it mean `viewAsSequence`, the name doesn't look any 
relevant to the logic behind it: filter first non empty expression.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to