Skip to content

Commit

Permalink
fix expect file
Browse files Browse the repository at this point in the history
  • Loading branch information
liangyepianzhou committed Oct 31, 2023
1 parent bfb532c commit 4ca25bc
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ results:
- metric:
labels:
- key: _
value: *
value: bookie:8000
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
value: .
value: {{ .value }}
traceid: null
- id: {{ notEmpty .id }}
value: null
traceid: null
{{- end}}
{{- end}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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:
- key: _
value: broker:8080
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
value: {{ .value }}
traceid: null
- id: {{ notEmpty .id }}
value: null
traceid: null
{{- end}}
{{- end}}
error: null
31 changes: 31 additions & 0 deletions test/e2e-v2/cases/pulsar/expected/metrics-has-value.yml
Original file line number Diff line number Diff line change
@@ -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
99 changes: 50 additions & 49 deletions test/e2e-v2/cases/pulsar/pulsar-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,106 +23,107 @@ cases:
expected: expected/bookie_instance.yml
# service cases for pulsar-cluster
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_total_topics --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-broker-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_total_subscriptions --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-broker-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_total_producers --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-broker-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_total_consumers --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-broker-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_message_rate_in --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-broker-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_message_rate_out --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-broker-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_throughput_in --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-broker-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_throughput_out --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-broker-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_storage_size --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-broker-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_storage_logical_size --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-broker-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_storage_write_rate --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-broker-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_storage_read_rate --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-broker-label.yml

# service cases for pulsar-broker
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_broker_active_connections --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_broker_total_connections --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_broker_connection_create_success_count --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_broker_connection_create_fail_count --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_broker_connection_closed_total_count --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_broker_jvm_memory_used --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_broker_jvm_memory_committed --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_broker_jvm_memory_init --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_broker_jvm_threads_current --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_broker_jvm_threads_daemon --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_broker_jvm_threads_peak --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_pulsar_broker_jvm_threads_deadlocked --service-name=pulsar::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml

# service cases for the bookkeeper cluster
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_bookie_ledgers_count --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-bookie-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_bookie_ledger_writable_dirs --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-bookie-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_bookie_ledger_dir_data_bookkeeper_ledgers_usage --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-bookie-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_bookie_entries_count --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-bookie-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_bookie_write_cache_size --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-bookie-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_bookie_write_cache_count --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-bookie-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_bookie_read_cache_size --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-bookie-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_bookie_read_cache_count --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-bookie-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_bookie_write_rate --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-bookie-label.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_bookie_read_rate --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value-instance-bookie-label.yml


# service cases for the bookkeeper node
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_thread_executor_completed --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_thread_executor_tasks_completed --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_thread_executor_tasks_rejected --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_thread_executor_tasks_failed --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_high_priority_threads --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_read_thread_pool_threads --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_high_priority_thread_max_queue_size --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_read_thread_pool_max_queue_size --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_jvm_memory_used --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_jvm_memory_committed --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_jvm_memory_init --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_jvm_threads_current --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_jvm_threads_daemon --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_jvm_threads_peak --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_bookkeeper_node_jvm_threads_deadlocked --service-name=bookkeeper::pulsar-cluster
expected: expected/metrics-has-value-instance-label.yml
expected: expected/metrics-has-value.yml

0 comments on commit 4ca25bc

Please sign in to comment.