wankai123 commented on code in PR #12431:
URL: https://github.com/apache/skywalking/pull/12431#discussion_r1674951191


##########
oap-server/server-query-plugin/promql-plugin/src/test/java/org/apache/skywalking/promql/rt/parser/PromQLExprQueryVisitorTest.java:
##########
@@ -117,6 +117,22 @@ public static Collection<Object[]> data() {
                 "service_cpm{service='serviceA', layer='GENERAL'} > 1",
                 ParseResultType.METRICS_RANGE,
                 List.of(new TimeValuePair(TIME_2023022012, "2"))
+            },
+            {
+                "MetricsAggregationOpSum",
+                PromQLApiHandler.QueryType.RANGE,
+                "sum by(service_instance_id) 
(http_requests_total{service='serviceA', layer='GENERAL'})",
+                ParseResultType.METRICS_RANGE,
+                List.of(new TimeValuePair(TIME_2023022010, "0.0"), new 
TimeValuePair(TIME_2023022011, "2.0"),
+                        new TimeValuePair(TIME_2023022012, "4.0"))
+            },
+            {
+                "MetricsAggregationOpAvg",
+                PromQLApiHandler.QueryType.RANGE,
+                "avg by(service_instance_id) 
(http_requests_total{service='serviceA', layer='GENERAL'})",
+                ParseResultType.METRICS_RANGE,
+                List.of(new TimeValuePair(TIME_2023022010, "0.0"), new 
TimeValuePair(TIME_2023022011, "1.0"),
+                        new TimeValuePair(TIME_2023022012, "2.0"))

Review Comment:
   I think we could add a parameter to verify the 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: [email protected]

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

Reply via email to