-
Notifications
You must be signed in to change notification settings - Fork 3.7k
branch-3.1: [feat](recycler) Add http api for statistics recycler metrics #52523 #53122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…#52523) call this api to directly know how many resources need to be recycled at this time (number and size (bytes)) in brpc metrics, even if config::enable_recycler_metrics is false ``` // metrics recycler_instance_to_recycle_num recycler_instance_to_recycle_bytes ``` usage: ``` // brpc_listen_port is port of recycler // If instance id is empty, no action will be performed. // if instance id is "*", it will statistics all instances curl "127.0.0.1:${brpc_listen_port}/RecyclerService/http/statistics_recycle?token=greedisgood9999" \ -d '{ "instance_ids" : ["*"], "resource_type" : ["recycle_indexes"] }' // if "resource_type" is empty or it is "*", it will statistics all resource types in all instances curl "127.0.0.1:${brpc_listen_port}/RecyclerService/http/statistics_recycle?token=xxxx" \ -d '{ "instance_ids" : ["default_instance_id", "default_instance_id_0", ...] }' curl "127.0.0.1:${brpc_listen_port}/RecyclerService/http/statistics_recycle?token=greedisgood9999" \ -d '{ "instance_ids" : ["*"] }' // else it is not empty, it will only stastics specified resource type // such as rowset, index, partition curl "127.0.0.1:${brpc_listen_port}/RecyclerService/http/statistics_recycle?token=xxxx" \ -d '{ "instance_ids" : ["default_instance_id", "default_instance_id_0", ...], "resource_type" : ["recycle_rowsets", "recycle_indexes", "recycle_partitions", ...] }' // invalid arg curl "127.0.0.1:5271/RecyclerService/http/statistics_recycle?token=xxx" \ -d '{ "instance_ids" : ["default_instance_id"], "resource_type" : ["11"] }' invalid resource type: invalid_resource_type, valid resource_type have [recycle_indexes, recycle_partitions, recycle_tmp_rowsets, recycle_rowsets, abort_timeout_txn, recycle_expired_txn_label, recycle_versions, recycle_copy_jobs, recycle_stage, recycle_expired_stage_objects, recycle_tablet, recycle_segment] curl "127.0.0.1:5271/RecyclerService/http/statistics_recycle?token=xxx" \ -d '{ "instance_ids" : ["invalid_instance_id"] }' invalid instance id: invalid_instance_id ``` eg. ``` curl "127.0.0.1:5271/RecyclerService/http/statistics_recycle?token=greedisgood9999" \ -d '{ "instance_ids" : ["*"], "resource_type" : ["*"] }' Instance ID: default_instance_id ---------------------------------------- Task Type: abort_timeout_txn • Need to abort timeout txn count: 0 items • Need to recycle timeout txn size: 0 bytes ---------------------------------------- Task Type: recycle_copy_jobs • Need to recycle copy job count: 0 items • Need to recycle copy job size: 0 bytes ---------------------------------------- Task Type: recycle_expired_stage_objects • Need to recycle expired stage object count: 0 items • Need to recycle expired stage object size: 0 bytes ---------------------------------------- Task Type: recycle_expired_txn_label • Need to recycle expired txn label count: 24 items • Need to recycle expired txn label size: 0 bytes ---------------------------------------- Task Type: recycle_indexes • Need to recycle index count: 4 items • Need to recycle index size: 16195 bytes ---------------------------------------- Task Type: recycle_partitions • Need to recycle partition count: 0 items • Need to recycle partition size: 0 bytes ---------------------------------------- Task Type: recycle_rowsets • Need to recycle rowset count: 9 items • Need to recycle rowset size: 7573 bytes ---------------------------------------- Task Type: recycle_segment • Need to recycle segment count: 48 items • Need to recycle segment size: 55604 bytes ---------------------------------------- Task Type: recycle_stage • Need to recycle stage count: 0 items • Need to recycle stage size: 0 bytes ---------------------------------------- Task Type: recycle_tablet • Need to recycle tablet count: 30 items • Need to recycle tablet size: 16195 bytes ---------------------------------------- Task Type: recycle_tmp_rowsets • Need to recycle tmp rowset count: 0 items • Need to recycle tmp rowset size: 0 bytes ---------------------------------------- Task Type: recycle_versions • Need to recycle version count: 0 items • Need to recycle version size: 0 bytes ---------------------------------------- ``` ``` curl "127.0.0.1:5271/RecyclerService/http/statistics_recycle?token=greedisgood9999" \ -d '{ "instance_ids" : ["*"], "resource_type" : ["recycle_indexes","recycle_tablet","recycle_segment","recycle_rowsets"] }' Instance ID: default_instance_id ---------------------------------------- Task Type: recycle_indexes • Need to recycle index count: 4 items • Need to recycle index size: 16195 bytes ---------------------------------------- Task Type: recycle_rowsets • Need to recycle rowset count: 9 items • Need to recycle rowset size: 7573 bytes ---------------------------------------- Task Type: recycle_segment • Need to recycle segment count: 48 items • Need to recycle segment size: 55604 bytes ---------------------------------------- Task Type: recycle_tablet • Need to recycle tablet count: 30 items • Need to recycle tablet size: 16195 bytes ---------------------------------------- ```
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
TPC-H: Total hot run time: 39653 ms |
TPC-DS: Total hot run time: 197294 ms |
ClickBench: Total hot run time: 30.99 s |
morrySnow
approved these changes
Jul 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
pick: #52523