- Notifications
You must be signed in to change notification settings - Fork 51
feat: add Quickperf for simple performance testing with JDBC #1619
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
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits Select commit Hold shift + click to select a range
6a6907e feat:Adding Quickperf for simple performance testing with JDBC
srozsnyai f776f5d Update samples/quickperf/src/main/java/com/google/cloud/jdbc/quickper…
srozsnyai faad8f6 Update samples/quickperf/src/main/java/com/google/cloud/jdbc/quickper…
srozsnyai 9cb1c2f Update samples/quickperf/src/main/java/com/google/cloud/jdbc/quickper…
srozsnyai bcf1894 Update samples/quickperf/readme.md
srozsnyai 2769587 Update samples/quickperf/src/main/java/com/google/cloud/jdbc/quickper…
srozsnyai 4695030 Update samples/quickperf/src/main/java/com/google/cloud/jdbc/quickper…
srozsnyai c095e94 Update samples/quickperf/src/main/java/com/google/cloud/jdbc/quickper…
srozsnyai 69b8dea Updating based on review comments #1619
srozsnyai 695246d Merge branch 'quickperf' of https://github.com/srozsnyai/java-spanner…
srozsnyai 4cec757 Updating based on review comments
srozsnyai fafc91e Incorporating additional changes from review #1619
srozsnyai fda85f5 Split app into two classes to separate app driver and app following r…
srozsnyai 60a355a fixed compilation issues
srozsnyai 10414f4 Update readme.md
srozsnyai 7e068f0 Update readme.md
srozsnyai 2080195 Update QuickPerf.java
srozsnyai 9225c1b Update ProgressTracker.java
srozsnyai 228d59b Merge branch 'main' into quickperf
olavloite 83df96b chore: add parent pom and run code formatter
olavloite b652ff8 chore: cleanup some warnings + simplify test setup
olavloite b129835 test: add test runner for quickperf
olavloite f1b6b1a chore: remove some more warnings
olavloite 71b6547 fix: include empty test file
olavloite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Copyright 2024 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # Github action job to test core java library features on | ||
| # downstream client libraries before they are released. | ||
| on: | ||
| pull_request: | ||
| name: quickperf | ||
| jobs: | ||
| quickperf: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: temurin | ||
| java-version: 17 | ||
| - name: Run tests | ||
| run: mvn test | ||
| working-directory: samples/quickperf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| target | ||
| .vscode | ||
| .DS_Store |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "project": "xxxx", | ||
| "instance": "xxx", | ||
| "database": "xxx", | ||
| "threads": 1, | ||
| "iterations": 100, | ||
| "query": "SELECT 1", | ||
| "writeMetricToFile": false | ||
| } |
13 changes: 13 additions & 0 deletions 13 samples/quickperf/exampleconfigs/users/groupmgt_config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "project": "xxx", | ||
| "instance": "xxx", | ||
| "database": "users", | ||
| "threads": 4, | ||
| "iterations": 250, | ||
| "query": "INSERT INTO GroupMgmt (group_id, grpname) VALUES(?,?)", | ||
| "writeMetricToFile": false, | ||
| "queryParams": [ | ||
| {"order": 1, "value": "#i"}, | ||
| {"order": 2, "value": "#s"} | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "project": "xxx", | ||
| "instance": "xxx", | ||
| "database": "users", | ||
| "threads": 1, | ||
| "iterations": 10, | ||
| "query": "SELECT users.user_id, membership.enrolled, GroupMgmt.grpname FROM users, GroupMgmt, membership WHERE users.user_id = ? AND users.user_id = membership.user_id AND GroupMgmt.group_id = membership.group_id", | ||
| "samplingQuery": "SELECT user_id FROM Users TABLESAMPLE RESERVOIR (100000 ROWS)", | ||
| "writeMetricToFile": false, | ||
| "queryParams": [ | ||
| {"order": 1, "value": "#pi"} | ||
| ] | ||
| } |
9 changes: 9 additions & 0 deletions 9 samples/quickperf/exampleconfigs/users/membership_config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "project": "xxx", | ||
| "instance": "xxx", | ||
| "database": "users", | ||
| "threads": 1, | ||
| "iterations": 100, | ||
| "query": "INSERT INTO membership(user_id, group_id, enrolled) VALUES((SELECT user_id FROM Users TABLESAMPLE RESERVOIR (1 ROWS)), (SELECT group_id FROM GroupMgmt TABLESAMPLE RESERVOIR (1 ROWS)), CURRENT_TIMESTAMP())", | ||
| "writeMetricToFile": false | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/bash | ||
| | ||
| # Generate Data | ||
| cd ../.. | ||
| | ||
| mvn -q compile | ||
| | ||
| mvn -q exec:java -Dexec.args="-c exampleconfigs/users/users_config.json" | ||
| | ||
| mvn -q exec:java -Dexec.args="-c exampleconfigs/users/groupmgt_config.json" | ||
| | ||
| mvn -q exec:java -Dexec.args="-c exampleconfigs/users/membership_config.json" | ||
| | ||
| # load test random users | ||
| mvn -q exec:java -Dexec.args="-c exampleconfigs/users/loadtestusers.json" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| CREATE TABLE GroupMgmt ( | ||
| group_id INT64, | ||
| grpname STRING(MAX), | ||
| ) PRIMARY KEY(group_id); | ||
| | ||
| CREATE TABLE Users ( | ||
| user_id INT64, | ||
| name STRING(MAX), | ||
| ) PRIMARY KEY(user_id); | ||
| | ||
| CREATE TABLE membership ( | ||
| user_id INT64, | ||
| group_id INT64, | ||
| enrolled TIMESTAMP NOT NULL OPTIONS ( | ||
| allow_commit_timestamp = true | ||
| ), | ||
| ) PRIMARY KEY(user_id, group_id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "project": "xxx", | ||
| "instance": "xxx", | ||
| "database": "users", | ||
| "threads": 1, | ||
| "iterations": 1000, | ||
| "query": "INSERT INTO Users (user_id, name) VALUES(?,?)", | ||
| "writeMetricToFile": false, | ||
| "queryParams": [ | ||
| {"order": 1, "value": "#i"}, | ||
| {"order": 2, "value": "#s"} | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ^/\*$ | ||
| ^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)$ | ||
| ^ \*$ | ||
| ^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ | ||
| ^ \* you may not use this file except in compliance with the License\.$ | ||
| ^ \* You may obtain a copy of the License at$ | ||
| ^ \*$ | ||
| ^ \*[ ]+https?://www.apache.org/licenses/LICENSE-2\.0$ | ||
| ^ \*$ | ||
| ^ \* Unless required by applicable law or agreed to in writing, software$ | ||
| ^ \* distributed under the License is distributed on an "AS IS" BASIS,$ | ||
| ^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$ | ||
| ^ \* See the License for the specific language governing permissions and$ | ||
| ^ \* limitations under the License\.$ | ||
| ^ \*/$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <?xml version="1.0"?> | ||
| <!DOCTYPE module PUBLIC | ||
| "-//Puppy Crawl//DTD Check Configuration 1.3//EN" | ||
| "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> | ||
| <module name="Checker"> | ||
| <module name="RegexpHeader"> | ||
| <property name="fileExtensions" value="java"/> | ||
| <property name="headerFile" value="${checkstyle.header.file}"/> | ||
| </module> | ||
| </module> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| | ||
| <groupId>com.google.cloud.jdbc.quickperf</groupId> | ||
| <artifactId>jdbc-quickperf</artifactId> | ||
| <version>1.0.0</version> | ||
| <name>jdbc-quickperf</name> | ||
| <parent> | ||
| <groupId>com.google.cloud</groupId> | ||
| <artifactId>sdk-platform-java-config</artifactId> | ||
| <version>3.34.0</version> | ||
| <relativePath/> | ||
| </parent> | ||
| | ||
| <properties> | ||
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| <maven.compiler.source>1.8</maven.compiler.source> | ||
| <maven.compiler.target>1.8</maven.compiler.target> | ||
| </properties> | ||
| | ||
| <dependencyManagement> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.google.cloud</groupId> | ||
| <artifactId>libraries-bom</artifactId> | ||
| <version>26.43.0</version> | ||
| <type>pom</type> | ||
| <scope>import</scope> | ||
| </dependency> | ||
| </dependencies> | ||
| </dependencyManagement> | ||
| | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>net.datafaker</groupId> | ||
| <artifactId>datafaker</artifactId> | ||
| <version>2.3.1</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.cloud</groupId> | ||
| <artifactId>google-cloud-spanner</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>commons-cli</groupId> | ||
| <artifactId>commons-cli</artifactId> | ||
| <version>1.5.0</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.cloud</groupId> | ||
| <artifactId>google-cloud-spanner-jdbc</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.commons</groupId> | ||
| <artifactId>commons-lang3</artifactId> | ||
| <version>3.13.0</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.fasterxml.jackson.core</groupId> | ||
| <artifactId>jackson-databind</artifactId> | ||
| <version>2.13.4.1</version> | ||
| </dependency> | ||
| <!-- Required for unit tests --> | ||
| <dependency> | ||
| <groupId>org.testcontainers</groupId> | ||
| <artifactId>testcontainers</artifactId> | ||
| <version>1.20.1</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot</artifactId> | ||
| <version>3.2.5</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>junit</groupId> | ||
| <artifactId>junit</artifactId> | ||
| <version>4.13.1</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> | ||
| | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.codehaus.mojo</groupId> | ||
| <artifactId>exec-maven-plugin</artifactId> | ||
| <version>3.1.0</version> | ||
| <configuration> | ||
| <mainClass>com.google.cloud.jdbc.quickperf.QuickPerf</mainClass> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| | ||
| </project> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.