Skip to content

[Improvement-#11768][Monitor] Support monitor h2 database in monitor page#11813

Merged
ruanwenjun merged 2 commits intoapache:devfrom
DarkAssassinator:addH2Monitor
Sep 9, 2022
Merged

[Improvement-#11768][Monitor] Support monitor h2 database in monitor page#11813
ruanwenjun merged 2 commits intoapache:devfrom
DarkAssassinator:addH2Monitor

Conversation

@DarkAssassinator
Copy link
Contributor

…1768

Purpose of the pull request

fix #11768

Brief change log

add H2 db performace monitor

Verify this pull request

This pull request is code cleanup without any test coverage.

Just add connection sessions monitor, becasue H2 DB do not have MAX_CONNECTION setting.


try {
pstmt = conn.createStatement();
try (ResultSet rs1 = pstmt.executeQuery("select count(*) as total from information_schema.sessions;")) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
try (ResultSet rs1 = pstmt.executeQuery("select count(*) as total from information_schema.sessions;")) {
try (ResultSet rs1 = pstmt.executeQuery("select count(1) as total from information_schema.sessions;")) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done. but i still think that count(1) ≈ count(*)

@SbloodyS SbloodyS added the improvement make more easy to user or prompt friendly label Sep 7, 2022
@SbloodyS SbloodyS added this to the 3.1.0 milestone Sep 7, 2022

Statement pstmt = null;

try {
Copy link
Member

Choose a reason for hiding this comment

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

Please use try-with-resource to close the Statement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please use try-with-resource to close the Statement

done. thx.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 7, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@caishunfeng caishunfeng left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

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

+1

@ruanwenjun ruanwenjun changed the title [Improvement][Monitor] Support monitor h2 database in monitor page #1… [Improvement-#11768][Monitor] Support monitor h2 database in monitor page Sep 8, 2022
@ruanwenjun ruanwenjun merged commit e20f17a into apache:dev Sep 9, 2022
xdu-chenrj pushed a commit to xdu-chenrj/dolphinscheduler that referenced this pull request Sep 10, 2022
xdu-chenrj pushed a commit to xdu-chenrj/dolphinscheduler that referenced this pull request Sep 10, 2022
@caishunfeng caishunfeng added the release cherry-pick Mark this issue/PR had cherry-pick for release version label Sep 19, 2022
xdu-chenrj pushed a commit to xdu-chenrj/dolphinscheduler that referenced this pull request Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend improvement make more easy to user or prompt friendly release cherry-pick Mark this issue/PR had cherry-pick for release version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement][Monitor] Support monitor h2 database in monitor page

4 participants