Skip to content

Commit 9e71e4d

Browse files
authored
chore(query): fix udf metrics (#17134)
* chore(query): fix udf metrics * chore(query): rename * chore(query): update * chore(query): add test parallel params * chore(query): add test parallel params * chore(query): add test parallel params * chore(query): add test parallel params
1 parent af5413f commit 9e71e4d

File tree

13 files changed

+49
-20
lines changed

13 files changed

+49
-20
lines changed

.github/actions/test_sqllogic_standalone_linux/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ inputs:
1313
description: "logic test handlers, mysql,http,clickhouse"
1414
required: true
1515
default: ""
16+
parallel:
17+
description: "logic test parallel"
18+
required: false
19+
default: ""
1620
storage-format:
1721
description: "storage format for databend query to test"
1822
required: true
@@ -38,6 +42,7 @@ runs:
3842
shell: bash
3943
env:
4044
TEST_HANDLERS: ${{ inputs.handlers }}
45+
TEST_PARALLEL: ${{ inputs.parallel }}
4146
CACHE_ENABLE_TABLE_META_CACHE: ${{ inputs.enable_table_meta_cache}}
4247
run: bash ./scripts/ci/ci-run-sqllogic-tests.sh ${{ inputs.dirs }}
4348

@@ -46,5 +51,6 @@ runs:
4651
shell: bash
4752
env:
4853
TEST_HANDLERS: ${{ inputs.handlers }}
54+
TEST_PARALLEL: ${{ inputs.parallel }}
4955
CACHE_ENABLE_TABLE_META_CACHE: ${{ inputs.enable_table_meta_cache}}
5056
run: bash ./scripts/ci/ci-run-sqllogic-tests-native.sh ${{ inputs.dirs }}

.github/workflows/reuse.sqllogic.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ jobs:
8484
with:
8585
dirs: udf_server
8686
handlers: mysql,http
87+
parallel: 1
8788
storage-format: all
8889
- name: Upload failure
8990
if: failure() || cancelled()

scripts/ci/ci-run-ee-sqllogic-tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ echo "Starting standalone DatabendQuery and DatabendMeta"
1010
./scripts/ci/deploy/databend-query-standalone.sh
1111

1212
TEST_HANDLERS=${TEST_HANDLERS:-"mysql,http"}
13+
TEST_PARALLEL=${TEST_PARALLEL:-8}
1314
BUILD_PROFILE=${BUILD_PROFILE:-debug}
1415

1516
RUN_DIR=""
@@ -19,4 +20,4 @@ fi
1920
echo "Run suites using argument: $RUN_DIR"
2021

2122
echo "Starting ee databend-sqllogic tests"
22-
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --enable_sandbox --parallel 8
23+
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --enable_sandbox --parallel ${TEST_PARALLEL}

scripts/ci/ci-run-sqllogic-tests-cloud.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ echo "Starting standalone DatabendQuery and DatabendMeta"
1010
./scripts/ci/deploy/databend-query-standalone.sh
1111

1212
TEST_HANDLERS=${TEST_HANDLERS:-"mysql,http"}
13+
TEST_PARALLEL=${TEST_PARALLEL:-8}
1314
BUILD_PROFILE=${BUILD_PROFILE:-debug}
1415

1516
RUN_DIR=""
@@ -19,4 +20,4 @@ fi
1920
echo "Run suites using argument: $RUN_DIR"
2021

2122
echo "Starting databend-sqllogic tests"
22-
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --skip_dir management,explain_native,ee --enable_sandbox --parallel 8
23+
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --skip_dir management,explain_native,ee --enable_sandbox --parallel ${TEST_PARALLEL}

scripts/ci/ci-run-sqllogic-tests-cluster.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ echo "Starting Cluster databend-query"
1212
export RUST_BACKTRACE=1
1313

1414
TEST_HANDLERS=${TEST_HANDLERS:-"mysql,http"}
15+
TEST_PARALLEL=${TEST_PARALLEL:-8}
1516
BUILD_PROFILE=${BUILD_PROFILE:-debug}
1617

1718
RUN_DIR=""
@@ -21,4 +22,4 @@ fi
2122
echo "Run suites using argument: $RUN_DIR"
2223

2324
echo "Starting databend-sqllogic tests"
24-
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --enable_sandbox --parallel 8 --skip_file tpcds_q64.test,tpcds_join_order.test
25+
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --enable_sandbox --parallel ${TEST_PARALLEL} --skip_file tpcds_q64.test,tpcds_join_order.test

scripts/ci/ci-run-sqllogic-tests-minio.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ echo "Starting standalone DatabendQuery and DatabendMeta"
2222
./scripts/ci/deploy/databend-query-standalone.sh
2323

2424
TEST_HANDLERS=${TEST_HANDLERS:-"mysql,http"}
25+
TEST_PARALLEL=${TEST_PARALLEL:-8}
2526
BUILD_PROFILE=${BUILD_PROFILE:-debug}
2627

2728
RUN_DIR=""
@@ -31,4 +32,4 @@ fi
3132
echo "Run suites using argument: $RUN_DIR"
3233

3334
echo "Starting databend-sqllogic tests"
34-
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --skip_dir management,explain_native,ee --enable_sandbox --parallel 8
35+
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --skip_dir management,explain_native,ee --enable_sandbox --parallel ${TEST_PARALLEL}

scripts/ci/ci-run-sqllogic-tests-native-minio.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ echo "Starting standalone DatabendQuery and DatabendMeta"
2222
./scripts/ci/deploy/databend-query-standalone-native.sh
2323

2424
TEST_HANDLERS=${TEST_HANDLERS:-"mysql,http"}
25+
TEST_PARALLEL=${TEST_PARALLEL:-8}
2526
BUILD_PROFILE=${BUILD_PROFILE:-debug}
2627

2728
RUN_DIR=""
@@ -31,4 +32,4 @@ fi
3132
echo "Run suites using argument: $RUN_DIR"
3233

3334
echo "Starting databend-sqllogic tests"
34-
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --skip_dir management,cluster,explain,tpch,ee --enable_sandbox --parallel 8
35+
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --skip_dir management,cluster,explain,tpch,ee --enable_sandbox --parallel ${TEST_PARALLEL}

scripts/ci/ci-run-sqllogic-tests-native.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ echo "Starting standalone DatabendQuery and DatabendMeta"
1010
./scripts/ci/deploy/databend-query-standalone-native.sh
1111

1212
TEST_HANDLERS=${TEST_HANDLERS:-"mysql,http"}
13+
TEST_PARALLEL=${TEST_PARALLEL:-8}
1314
BUILD_PROFILE=${BUILD_PROFILE:-debug}
1415

1516
RUN_DIR=""
@@ -19,4 +20,4 @@ fi
1920
echo "Run suites using argument: $RUN_DIR"
2021

2122
echo "Starting databend-sqllogic tests"
22-
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --skip_dir management,cluster,explain,tpch,ee --enable_sandbox --parallel 8
23+
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --skip_dir management,cluster,explain,tpch,ee --enable_sandbox --parallel ${TEST_PARALLEL}

scripts/ci/ci-run-sqllogic-tests.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ echo "Starting standalone DatabendQuery and DatabendMeta"
1010
./scripts/ci/deploy/databend-query-standalone.sh
1111

1212
TEST_HANDLERS=${TEST_HANDLERS:-"mysql,http"}
13+
TEST_PARALLEL=${TEST_PARALLEL:-8}
1314
BUILD_PROFILE=${BUILD_PROFILE:-debug}
1415

1516
RUN_DIR=""
@@ -20,6 +21,6 @@ echo "Run suites using argument: $RUN_DIR"
2021

2122
echo "Starting databend-sqllogic tests"
2223
if [ -z "$RUN_DIR" ]; then
23-
target/${BUILD_PROFILE}/databend-sqllogictests --run_dir temp_table --enable_sandbox --parallel 8
24+
target/${BUILD_PROFILE}/databend-sqllogictests --run_dir temp_table --enable_sandbox --parallel ${TEST_PARALLEL}
2425
fi
25-
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --skip_dir management,explain_native,ee,temp_table --enable_sandbox --parallel 8
26+
target/${BUILD_PROFILE}/databend-sqllogictests --handlers ${TEST_HANDLERS} ${RUN_DIR} --skip_dir management,explain_native,ee,temp_table --enable_sandbox --parallel ${TEST_PARALLEL}

src/common/metrics/src/metrics/external_server.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const METRIC_RETRY: &str = "external_retry";
2929
const METRIC_ERROR: &str = "external_error";
3030
const METRIC_RUNNING_REQUESTS: &str = "external_running_requests";
3131
const METRIC_REQUESTS: &str = "external_requests";
32-
const METRIC_EXTERNAL_BLOCK_ROWS: &str = "external_block_rows";
32+
const METRIC_EXTERNAL_BATCH_ROWS: &str = "external_batch_rows";
3333

3434
static REQUEST_EXTERNAL_DURATION: LazyLock<FamilyHistogram<VecLabels>> =
3535
LazyLock::new(|| register_histogram_family_in_milliseconds(METRIC_REQUEST_EXTERNAL_DURATION));
@@ -49,8 +49,8 @@ static RUNNING_REQUESTS_EXTERNAL: LazyLock<FamilyCounter<VecLabels>> =
4949
static REQUESTS_EXTERNAL_EXTERNAL: LazyLock<FamilyCounter<VecLabels>> =
5050
LazyLock::new(|| register_counter_family(METRIC_REQUESTS));
5151

52-
static EXTERNAL_BLOCK_ROWS: LazyLock<FamilyHistogram<VecLabels>> =
53-
LazyLock::new(|| register_histogram_family_in_rows(METRIC_EXTERNAL_BLOCK_ROWS));
52+
static EXTERNAL_BATCH_ROWS: LazyLock<FamilyHistogram<VecLabels>> =
53+
LazyLock::new(|| register_histogram_family_in_rows(METRIC_EXTERNAL_BATCH_ROWS));
5454

5555
const LABEL_FUNCTION_NAME: &str = "function_name";
5656
const LABEL_ERROR_KIND: &str = "error_kind";
@@ -69,9 +69,9 @@ pub fn record_request_external_duration(function_name: impl Into<String>, durati
6969
.observe(duration.as_millis_f64());
7070
}
7171

72-
pub fn record_request_external_block_rows(function_name: impl Into<String>, rows: usize) {
72+
pub fn record_request_external_batch_rows(function_name: impl Into<String>, rows: usize) {
7373
let labels = &vec![(LABEL_FUNCTION_NAME, function_name.into())];
74-
EXTERNAL_BLOCK_ROWS
74+
EXTERNAL_BATCH_ROWS
7575
.get_or_create(labels)
7676
.observe(rows as f64);
7777
}

0 commit comments

Comments
 (0)