Update virtual cache e2e test case to apply MQE (#11151)

This commit is contained in:
pg.yang 2023-07-30 16:07:22 +08:00 committed by GitHub
parent 33ea0f1347
commit f14a4b007d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 68 additions and 9 deletions

View File

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

View File

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

View File

@ -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
expected: expected/metrics-has-value.yml