-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[feat](recycler) Add http api for statistics recycler metrics #52523
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
|
run buildall |
14320b4 to
fc188af
Compare
|
run buildall |
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
TPC-H: Total hot run time: 35409 ms |
TPC-DS: Total hot run time: 189142 ms |
ClickBench: Total hot run time: 31.18 s |
FE UT Coverage ReportIncrement line coverage `` 🎉 |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run p0 |
fc188af to
a024283
Compare
|
run buildall |
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
FE UT Coverage ReportIncrement line coverage `` 🎉 |
TPC-H: Total hot run time: 33937 ms |
TPC-DS: Total hot run time: 184697 ms |
ClickBench: Total hot run time: 30.19 s |
a024283 to
fbb751d
Compare
|
run buildall |
TPC-H: Total hot run time: 33989 ms |
|
PR approved by anyone and no changes requested. |
TPC-DS: Total hot run time: 184812 ms |
ecf3f67 to
08db574
Compare
|
run buildall |
|
PR approved by at least one committer and no changes requested. |
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
FE UT Coverage ReportIncrement line coverage `` 🎉 |
TPC-H: Total hot run time: 33287 ms |
TPC-DS: Total hot run time: 186930 ms |
ClickBench: Total hot run time: 30.22 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run cloud_p0 |
|
run nonConcurrent |
### 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
----------------------------------------
```
…#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 ---------------------------------------- ```
…#52523) ### 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 ---------------------------------------- ```
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
usage:
eg.
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)