-
Notifications
You must be signed in to change notification settings - Fork 3.7k
branch-3.0: [feat](recycler) Add http api for statistics recycler metrics #52523 #53117
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
Conversation
### Release note
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
----------------------------------------
```
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
dataroaring
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
Cherry-picked from #52523