Skip to content
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

[Feature] add sys.fe_memory_usage table #40464

Merged
merged 9 commits into from Feb 7, 2024

Conversation

Astralidea
Copy link
Contributor

@Astralidea Astralidea commented Jan 31, 2024

Why I'm doing:
Although we have log monitoring, for some environments, users may not have a way to directly obtain log information and view it, so we expose a metadata table to check the current memory statistics.

What I'm doing:

Fixes #issue

+--------------+------------------------------+---------------------+------------------+------------------------------------------------------------+
| module_name  | class_name                   | current_consumption | peak_consumption | counter_info                                               |
+--------------+------------------------------+---------------------+------------------+------------------------------------------------------------+
| Delete       | DeleteMgr                    |                 416 |              416 | {"DeleteInfo":0}                                           |
| Load         | LoadMgr                      |            12187384 |         12187384 | {"LoadJob":0}                                              |
| Load         | RoutineLoadMgr               |                 592 |              592 | {"RoutineLoad":0}                                          |
| Load         | StreamLoadMgr                |                 376 |              376 | {"StreamLoad":0}                                           |
| Task         | TaskManager                  |                  80 |               80 | {"Task":0}                                                 |
| Task         | TaskRunManager               |            12187384 |         12187384 | {"PendingTaskRun":0,"RunningTaskRun":0,"HistoryTaskRun":0} |
| Report       | ReportHandler                |            12188992 |         12188992 | {"PendingTask":0,"ReportQueue":0}                          |
| Backup       | BackupHandler                |            12183864 |         14562256 | {"BackupOrRestoreJob":0}                                   |
| Coordinator  | QeProcessorImpl              |                 240 |              240 | {"QueryInfo":0}                                            |
| Profile      | ProfileManager               |                 112 |              112 | {"Profile":0,"LoadProfile":0}                              |
| Transaction  | GlobalTransactionMgr         |            12183864 |         12183864 | {"Transaction":0}                                          |
| Dict         | CacheDictManager             |            12188768 |         12188768 | {"ColumnDict":0}                                           |
| Export       | ExportMgr                    |                 248 |              248 | {"ExportJob":0}                                            |
| Tablet       | TabletInvertedIndex          |               30168 |            30168 | {"TabletMeta":48}                                          |
| LocalCatalog | InternalCatalogMemoryTracker |               33424 |            33424 | {"Partition":5}                                            |
+--------------+------------------------------+---------------------+------------------+------------------------------------------------------------+

What type of PR is this:

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

Does this PR entail a change in behavior?

  • 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.2
    • 3.1
    • 3.0
    • 2.5

Signed-off-by: Astralidea <astralidea@163.com>
Signed-off-by: Astralidea <astralidea@163.com>
Signed-off-by: Xueyan Li <astralidea@163.com>
Copy link
Contributor

@imay imay left a comment

Choose a reason for hiding this comment

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

Add some sql-test to cover this new sys table

be/src/exec/schema_scanner/sys_fe_memory_usage.cpp Outdated Show resolved Hide resolved
gensrc/thrift/FrontendService.thrift Outdated Show resolved Hide resolved
Signed-off-by: Astralidea <astralidea@163.com>
Signed-off-by: Astralidea <astralidea@163.com>
Signed-off-by: Astralidea <astralidea@163.com>
@Astralidea Astralidea enabled auto-merge (squash) February 4, 2024 03:36
@nshangyiming nshangyiming self-assigned this Feb 4, 2024
Signed-off-by: Astralidea <astralidea@163.com>
Copy link

sonarcloud bot commented Feb 7, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

5 New issues
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

github-actions bot commented Feb 7, 2024

[FE Incremental Coverage Report]

pass : 44 / 47 (93.62%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/catalog/system/sys/SysFeMemoryUsage.java 28 31 90.32% [35, 64, 65]
🔵 com/starrocks/catalog/system/sys/SysDb.java 1 1 100.00% []
🔵 com/starrocks/service/FrontendServiceImpl.java 1 1 100.00% []
🔵 com/starrocks/memory/MemoryStat.java 3 3 100.00% []
🔵 com/starrocks/memory/MemoryUsageTracker.java 11 11 100.00% []

Copy link

github-actions bot commented Feb 7, 2024

[BE Incremental Coverage Report]

pass : 34 / 34 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/exec/schema_scanner.cpp 2 2 100.00% []
🔵 be/src/exec/schema_scanner/sys_fe_memory_usage.cpp 29 29 100.00% []
🔵 be/src/exec/schema_scanner/schema_helper.cpp 3 3 100.00% []

@Astralidea Astralidea merged commit 49d4380 into StarRocks:main Feb 7, 2024
51 of 54 checks passed
@Astralidea
Copy link
Contributor Author

https://github.com/Mergifyio backport branch-3.2

Copy link
Contributor

mergify bot commented Feb 18, 2024

backport branch-3.2

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Feb 18, 2024
Signed-off-by: Astralidea <astralidea@163.com>
Signed-off-by: Xueyan Li <astralidea@163.com>
(cherry picked from commit 49d4380)

# Conflicts:
#	be/src/exec/schema_scanner.cpp
#	fe/fe-core/src/main/java/com/starrocks/catalog/system/SystemId.java
#	gensrc/thrift/Descriptors.thrift
Astralidea added a commit that referenced this pull request Feb 18, 2024
Signed-off-by: Astralidea <astralidea@163.com>
Astralidea added a commit that referenced this pull request Feb 18, 2024
Signed-off-by: Astralidea <astralidea@163.com>
Astralidea added a commit that referenced this pull request Feb 19, 2024
Signed-off-by: Astralidea <astralidea@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants