diff --git a/test/e2e-v2/cases/meter/expected/virtual_cache_has_metrics.yml b/test/e2e-v2/cases/meter/expected/virtual_cache_has_metrics.yml new file mode 100644 index 0000000000..8569a6c56f --- /dev/null +++ b/test/e2e-v2/cases/meter/expected/virtual_cache_has_metrics.yml @@ -0,0 +1,31 @@ +# 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. + +type: TIME_SERIES_VALUES +results: + {{- contains .results }} +- metric: + labels: [] + values: + {{- contains .values }} + - id: {{ notEmpty .id }} + value: {{ .value }} + traceid: null + - id: {{ notEmpty .id }} + value: null + traceid: null + {{- end}} + {{- end}} +error: null diff --git a/test/e2e-v2/cases/meter/expected/virtual_cache_has_topN_records.yml b/test/e2e-v2/cases/meter/expected/virtual_cache_has_topN_records.yml new file mode 100644 index 0000000000..6fe927e268 --- /dev/null +++ b/test/e2e-v2/cases/meter/expected/virtual_cache_has_topN_records.yml @@ -0,0 +1,28 @@ +# 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. + +type: RECORD_LIST +results: + {{- contains .results }} + - metric: + labels: [] + values: + {{- contains .values }} + - id: {{ notEmpty .id }} + value: {{ notEmpty .value }} + traceid: {{ notEmpty .traceid }} + {{- end}} + {{- end}} +error: null diff --git a/test/e2e-v2/cases/meter/meter-cases.yaml b/test/e2e-v2/cases/meter/meter-cases.yaml index 02e05a2143..db54712f1f 100644 --- a/test/e2e-v2/cases/meter/meter-cases.yaml +++ b/test/e2e-v2/cases/meter/meter-cases.yaml @@ -34,18 +34,18 @@ expected: expected/metrics-has-value.yml # virtual cache - query: | - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=cache_read_resp_time --service-id=R3VhdmFDYWNoZS1sb2NhbA==.0 | yq e 'to_entries' - - expected: expected/metrics-has-value.yml + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=cache_read_resp_time --service-id=R3VhdmFDYWNoZS1sb2NhbA==.0 + expected: expected/virtual_cache_has_metrics.yml - query: | - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=cache_write_sla --service-id=R3VhdmFDYWNoZS1sb2NhbA==.0 | yq e 'to_entries' - - expected: expected/metrics-has-value.yml + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=cache_write_sla --service-id=R3VhdmFDYWNoZS1sb2NhbA==.0 + expected: expected/virtual_cache_has_metrics.yml - query: | - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=cache_access_cpm --service-id=R3VhdmFDYWNoZS1sb2NhbA==.0 | yq e 'to_entries' - - expected: expected/metrics-has-value.yml + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=cache_access_cpm --service-id=R3VhdmFDYWNoZS1sb2NhbA==.0 + expected: expected/virtual_cache_has_metrics.yml - query: | - swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql records list --name=top_n_cache_write_command --service-id=R3VhdmFDYWNoZS1sb2NhbA==.0 | yq e 'to_entries | with(.[] ; .value=(.value | to_entries))' - - expected: expected/record-has-value.yml + swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression="top_n(top_n_cache_write_command,10,des)" --service-id=R3VhdmFDYWNoZS1sb2NhbA==.0 + expected: expected/virtual_cache_has_topN_records.yml # virtual database - query: | swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=database_access_resp_time --service-id=bG9jYWxob3N0Oi0x.0 | yq e 'to_entries' - - expected: expected/metrics-has-value.yml \ No newline at end of file + expected: expected/metrics-has-value.yml