Skip to content

Conversation

@flaneur2020
Copy link
Member

@flaneur2020 flaneur2020 commented Jan 13, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

currently we've tracked the scan rows/bytes, write rows/bytes progress value in query stats. and collected them into metrics in query_finished.

but this have an issue like, given a COPY statement which executed for 10 hours. this databend_query_scan_rows will kept to be zero during the executation, can not reflect the executing progress in metrics.

this pr add a hook on the Progress struct to increment the global metrics as well as the local stats.

Tests

  • No Test - simple metrics enhancement

Type of change

  • Other (please describe): observability

This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Jan 13, 2025
@flaneur2020 flaneur2020 marked this pull request as ready for review January 13, 2025 12:21
@BohuTANG BohuTANG requested a review from zhang2014 January 14, 2025 00:31
@zhang2014 zhang2014 added the ci-benchmark Benchmark: run all test label Jan 14, 2025
@zhang2014
Copy link
Member

The metrics recorder has some locks, let's run the performance tests.

self.rows.fetch_add(progress_values.rows, Ordering::Relaxed);
self.bytes
.fetch_add(progress_values.bytes, Ordering::Relaxed);
if let Some(hook) = &self.hook {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might result in double counting if cluster mode.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you help explain more about this?

@github-actions
Copy link
Contributor

Docker Image for PR

  • tag: pr-17266-8c7f6a2-1736830465

note: this image tag is only available for internal use,
please check the internal doc for more details.

@flaneur2020
Copy link
Member Author

close this due to performance decrease, let me try another with prometheus' collector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-benchmark Benchmark: run all test pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants