starrocks icon indicating copy to clipboard operation
starrocks copied to clipboard

[Draft] [Feature] make profile async and turn on profile on default

Open before-Sunrise opened this issue 6 months ago • 3 comments

Why I'm doing:

What I'm doing:

  1. make profile report async in BE, profile merge and report will in other thread pool instead of pipeline-exec query pool
  2. split profile from ExecStateReport, use another thrift rpc. Right now Exec state report has too much information including query exec state/ load state etc, better to split profile from this interface since profile is less important
  3. optimize profile merge and ToThrift method. Using a Block-grained mempool to let counters in same level can be near by each other, this is cache-friendly for our top-down counter-merge algorithm and ToThrift method
  4. for counter which value is zero, don't display it. For unique metrics, display threshold is controled by be config:counter_display_threshold, default value is 50. These thresholds can delete useless counter

Fixes #https://github.com/StarRocks/starrocks/issues/58868

What type of PR is this:

  • [ ] BugFix
  • [ ] Feature
  • [ ] Enhancement
  • [ ] Refactor
  • [ ] UT
  • [ ] Doc
  • [ ] Tool

Does this PR entail a change in behavior?

  • [x] Yes, this PR will result in a change in behavior.
  • [ ] No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • [ ] Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • [ ] Parameter changes: default values, similar parameters but with different default values
  • [ ] Policy changes: use new policy to replace old one, functionality automatically enabled
  • [ ] Feature removed
  • [ ] Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • [ ] I have added test cases for my bug fix or my new feature
  • [ ] This pr needs user documentation (for new or modified features or behaviors)
    • [ ] I have added documentation for my new feature or new function
  • [ ] This is a backport pr

Bugfix cherry-pick branch check:

  • [ ] I have checked the version labels which the pr will be auto-backported to the target branch
    • [ ] 3.5
    • [ ] 3.4
    • [ ] 3.3

before-Sunrise avatar Jun 17 '25 02:06 before-Sunrise

[Java-Extensions Incremental Coverage Report]

:white_check_mark: pass : 0 / 0 (0%)

github-actions[bot] avatar Jul 15 '25 08:07 github-actions[bot]

[FE Incremental Coverage Report]

:white_check_mark: pass : 276 / 341 (80.94%)

file detail

path covered_line new_line coverage not_covered_line_detail
:large_blue_circle: com/starrocks/qe/scheduler/FeExecuteCoordinator.java 0 1 00.00% [308]
:large_blue_circle: com/starrocks/service/FrontendServiceImpl.java 0 1 00.00% [3226]
:large_blue_circle: com/starrocks/load/loadv2/LoadLoadingTask.java 0 1 00.00% [260]
:large_blue_circle: com/starrocks/load/streamload/StreamLoadTask.java 0 1 00.00% [1147]
:large_blue_circle: com/starrocks/catalog/DictionaryMgr.java 0 1 00.00% [588]
:large_blue_circle: com/starrocks/http/rest/RunningProfileAction.java 4 9 44.44% [39, 40, 42, 43, 44]
:large_blue_circle: com/starrocks/qe/scheduler/QueryRuntimeProfile.java 63 83 75.90% [301, 302, 303, 322, 323, 325, 327, 328, 329, 330, 332, 393, 454, 460, 461, 468, 616, 683, 732, 755]
:large_blue_circle: com/starrocks/qe/DefaultCoordinator.java 13 17 76.47% [1276, 1278, 1279, 1368]
:large_blue_circle: com/starrocks/qe/StmtExecutor.java 49 60 81.67% [363, 365, 1063, 1089, 1100, 1101, 1104, 1125, 2909, 2912, 2913]
:large_blue_circle: com/starrocks/common/util/RunningProfileManager.java 102 121 84.30% [78, 123, 124, 141, 142, 235, 243, 245, 246, 247, 248, 250, 255, 256, 257, 258, 259, 260, 261]
:large_blue_circle: com/starrocks/qe/SessionVariable.java 7 8 87.50% [5150]
:large_blue_circle: com/starrocks/load/batchwrite/MergeCommitTask.java 1 1 100.00% []
:large_blue_circle: com/starrocks/scheduler/PartitionBasedMvRefreshProcessor.java 1 1 100.00% []
:large_blue_circle: com/starrocks/sql/PrepareStmtPlanner.java 1 1 100.00% []
:large_blue_circle: com/starrocks/qe/scheduler/dag/JobSpec.java 1 1 100.00% []
:large_blue_circle: com/starrocks/qe/ConnectContext.java 4 4 100.00% []
:large_blue_circle: com/starrocks/qe/ConnectProcessor.java 20 20 100.00% []
:large_blue_circle: com/starrocks/qe/QeProcessorImpl.java 1 1 100.00% []
:large_blue_circle: com/starrocks/connector/metadata/MetadataCollectJob.java 1 1 100.00% []
:large_blue_circle: com/starrocks/qe/scheduler/dag/ExecutionDAG.java 4 4 100.00% []
:large_blue_circle: com/starrocks/statistic/StatisticExecutor.java 1 1 100.00% []
:large_blue_circle: com/starrocks/statistic/StatisticUtils.java 1 1 100.00% []
:large_blue_circle: com/starrocks/memory/MemoryUsageTracker.java 1 1 100.00% []
:large_blue_circle: com/starrocks/http/HttpServer.java 1 1 100.00% []

github-actions[bot] avatar Jul 15 '25 08:07 github-actions[bot]

[BE Incremental Coverage Report]

:x: fail : 125 / 277 (45.13%)

file detail

path covered_line new_line coverage not_covered_line_detail
:large_blue_circle: be/src/exec/pipeline/exec_state_reporter.cpp 0 3 00.00% [70, 82, 83]
:large_blue_circle: be/src/exec/pipeline/pipeline_driver_executor.cpp 1 22 04.55% [321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 338, 341, 343, 345, 351, 352]
:large_blue_circle: be/src/exec/pipeline/profile_manager.h 1 14 07.14% [43, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60]
:large_blue_circle: be/src/exec/pipeline/profile_manager.cpp 22 124 17.74% [14, 16, 17, 18, 19, 21, 22, 23, 24, 25, 27, 29, 30, 31, 33, 34, 35, 36, 38, 39, 42, 45, 49, 50, 52, 53, 55, 56, 57, 58, 59, 60, 62, 65, 67, 68, 69, 71, 72, 73, 75, 76, 78, 80, 81, 83, 96, 97, 111, 112, 120, 121, 122, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 143, 144, 145, 146, 148, 149, 153, 154, 155, 157, 158, 159, 161, 163, 164, 165, 166, 168, 170, 173, 174, 175, 176, 177, 179, 180, 182, 184, 185, 188, 189]
:large_blue_circle: be/src/util/counter_memory_pool.h 1 2 50.00% [30]
:large_blue_circle: be/src/exec/pipeline/pipeline.cpp 5 6 83.33% [141]
:large_blue_circle: be/src/util/runtime_profile.cpp 73 84 86.90% [91, 92, 93, 94, 135, 362, 363, 364, 365, 970, 1008]
:large_blue_circle: be/src/exec/pipeline/operator.cpp 3 3 100.00% []
:large_blue_circle: be/src/util/runtime_profile.h 1 1 100.00% []
:large_blue_circle: be/src/runtime/exec_env.h 1 1 100.00% []
:large_blue_circle: be/src/runtime/exec_env.cpp 1 1 100.00% []
:large_blue_circle: be/src/exec/pipeline/pipeline_driver.h 1 1 100.00% []
:large_blue_circle: be/src/exec/pipeline/operator.h 1 1 100.00% []
:large_blue_circle: be/src/exec/pipeline/pipeline.h 1 1 100.00% []
:large_blue_circle: be/src/util/counter_memory_pool.cpp 13 13 100.00% []

github-actions[bot] avatar Jul 15 '25 08:07 github-actions[bot]

ignore merge 4.0.0-rc01

wangsimo0 avatar Aug 11 '25 09:08 wangsimo0

don't forget to cp to branch-4.0

wangsimo0 avatar Aug 11 '25 09:08 wangsimo0