Skip to content

Commit f8ca745

Browse files
jakobbraunmorazow
andauthored
feature/20 jprofiler (#22)
* #20 Added module for JProfiler Co-authored-by: Muhammet Orazov <m.orazow@gmail.com>
1 parent 0827ed9 commit f8ca745

File tree

15 files changed

+327
-114
lines changed

15 files changed

+327
-114
lines changed

.github/workflows/broken_links_checker.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- name: lychee Link Checker
14-
id: lc
15-
uses: lycheeverse/lychee-action@v1.0.6
16-
- name: Fail if there were link errors
17-
run: exit ${{ steps.lc.outputs.exit_code }}
13+
- uses: gaurav-nelson/github-action-markdown-link-check@v1
14+
with:
15+
use-quiet-mode: 'yes'
16+
use-verbose-mode: 'yes'

.github/workflows/release_droid_upload_github_release_assets.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,9 @@ jobs:
3232
uses: shogo82148/actions-upload-release-asset@v1
3333
with:
3434
upload_url: ${{ github.event.inputs.upload_url }}
35-
asset_path: target/*.jar
35+
asset_path: target/*.jar
36+
- name: Upload error-code-report
37+
uses: shogo82148/actions-upload-release-asset@v1
38+
with:
39+
upload_url: ${{ github.event.inputs.upload_url }}
40+
asset_path: target/error_code_report.json

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,29 @@ This module installs a jacoco agent to the UDF JVM and receives the execution da
5151

5252
This module requires additional maven configuration. Use the [project-keeper's](https://github.com/exasol/project-keeper-maven-plugin) `udf_coverage` module to verify it.
5353

54+
### JProfiler
55+
56+
System property: `test.jprofiler`
57+
58+
This module allows you to profile UDF runs using [JProfiler](https://www.ej-technologies.com/products/jprofiler/overview.html). For that it uploads the JProfiler archive to BucketFs and adds the agent to the UDF command.
59+
60+
Since JProfiler uses a forward TCP connection you can only profile one UDF instance at once. Make sure that you don't start multiple parallel instances.
61+
62+
#### Usage
63+
64+
* Install JProfiler on your system
65+
* Download JProfiler for Linux without JRE as `.tar.gz` (Also choose the Linux version if you're on a different operating system!)
66+
* Now you've two options:
67+
* Store it as `jprofiler.tar.gz` in your home directory
68+
* Store it somewhere and pass `-DjProfilerAgent=<path to the archive.tar.gz>` to each test run
69+
* Run your tests with `-Dtest.jprofiler=true`
70+
* Find out the IPv4 address of your Exasol DB (for docker use `docker inspect`)
71+
* Start JProfiler GUI
72+
* Connect to `<EXASOL_IP>:11002`
73+
* The UDF execution will wait until you connect the profiler
74+
* Ensure that the port is reachable from your system (for AWS instances you can use an SSH tunnel from inside JProfiler)
75+
5476
## Additional Information
5577

5678
* [Changelog](doc/changes/changelog.md)
5779
* [Dependencies](dependencies.md)
58-

dependencies.md

Lines changed: 67 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -10,87 +10,90 @@
1010
| [JaCoCo :: Core][4] | [Eclipse Public License 2.0][5] |
1111
| [BucketFS Java][6] | [MIT][3] |
1212
| [exasol-test-setup-abstraction-java][8] | [MIT][3] |
13-
| [Test Database Builder for Java][10] | [MIT][3] |
14-
| [SLF4J API Module][12] | [MIT License][13] |
13+
| [Apache Commons Compress][10] | [Apache License, Version 2.0][11] |
14+
| [Test Database Builder for Java][12] | [MIT][3] |
15+
| [SLF4J API Module][14] | [MIT License][15] |
1516

1617
## Test Dependencies
1718

1819
| Dependency | License |
1920
| ----------------------------------------------- | --------------------------------- |
2021
| [JaCoCo :: Agent][4] | [Eclipse Public License 2.0][5] |
21-
| [JUnit Jupiter Engine][16] | [Eclipse Public License v2.0][17] |
22-
| [JUnit Jupiter Params][16] | [Eclipse Public License v2.0][17] |
23-
| [mockito-core][20] | [The MIT License][21] |
24-
| [Hamcrest All][22] | [New BSD License][23] |
25-
| [Test containers for Exasol on Docker][24] | [MIT][3] |
26-
| [Testcontainers :: JUnit Jupiter Extension][26] | [MIT][27] |
22+
| [JUnit Jupiter Engine][18] | [Eclipse Public License v2.0][19] |
23+
| [JUnit Jupiter Params][18] | [Eclipse Public License v2.0][19] |
24+
| [mockito-core][22] | [The MIT License][23] |
25+
| [Hamcrest All][24] | [New BSD License][25] |
26+
| [Test containers for Exasol on Docker][26] | [MIT][3] |
27+
| [Testcontainers :: JUnit Jupiter Extension][28] | [MIT][29] |
2728

2829
## Plugin Dependencies
2930

3031
| Dependency | License |
3132
| ------------------------------------------------------- | ---------------------------------------------- |
32-
| [Maven Surefire Plugin][28] | [Apache License, Version 2.0][29] |
33-
| [Maven Failsafe Plugin][30] | [Apache License, Version 2.0][29] |
34-
| [JaCoCo :: Maven Plugin][4] | [Eclipse Public License 2.0][5] |
35-
| [Apache Maven Compiler Plugin][34] | [Apache License, Version 2.0][29] |
36-
| [Maven Dependency Plugin][36] | [The Apache Software License, Version 2.0][37] |
37-
| [Versions Maven Plugin][38] | [Apache License, Version 2.0][29] |
38-
| [Apache Maven Source Plugin][40] | [Apache License, Version 2.0][29] |
39-
| [Apache Maven Javadoc Plugin][42] | [Apache License, Version 2.0][29] |
40-
| [Apache Maven GPG Plugin][44] | [Apache License, Version 2.0][37] |
41-
| [org.sonatype.ossindex.maven:ossindex-maven-plugin][46] | [ASL2][37] |
42-
| [Apache Maven Enforcer Plugin][48] | [Apache License, Version 2.0][29] |
43-
| [Project keeper maven plugin][50] | [MIT][3] |
44-
| [Maven Deploy Plugin][52] | [The Apache Software License, Version 2.0][37] |
45-
| [Nexus Staging Maven Plugin][54] | [Eclipse Public License][55] |
46-
| [error-code-crawler-maven-plugin][56] | [MIT][3] |
47-
| [Reproducible Build Maven Plugin][58] | [Apache 2.0][37] |
48-
| [Maven Clean Plugin][60] | [The Apache Software License, Version 2.0][37] |
49-
| [Maven Resources Plugin][62] | [The Apache Software License, Version 2.0][37] |
50-
| [Maven JAR Plugin][64] | [The Apache Software License, Version 2.0][37] |
51-
| [Maven Install Plugin][66] | [The Apache Software License, Version 2.0][37] |
52-
| [Maven Site Plugin 3][68] | [The Apache Software License, Version 2.0][37] |
33+
| [Maven Surefire Plugin][30] | [Apache License, Version 2.0][11] |
34+
| [Maven Failsafe Plugin][32] | [Apache License, Version 2.0][11] |
35+
| [JaCoCo :: Maven Plugin][34] | [Eclipse Public License 2.0][5] |
36+
| [Apache Maven Compiler Plugin][36] | [Apache License, Version 2.0][11] |
37+
| [Maven Dependency Plugin][38] | [The Apache Software License, Version 2.0][39] |
38+
| [Versions Maven Plugin][40] | [Apache License, Version 2.0][11] |
39+
| [Apache Maven Source Plugin][42] | [Apache License, Version 2.0][11] |
40+
| [Apache Maven Javadoc Plugin][44] | [Apache License, Version 2.0][11] |
41+
| [Apache Maven GPG Plugin][46] | [Apache License, Version 2.0][39] |
42+
| [org.sonatype.ossindex.maven:ossindex-maven-plugin][48] | [ASL2][39] |
43+
| [Apache Maven Enforcer Plugin][50] | [Apache License, Version 2.0][11] |
44+
| [Project keeper maven plugin][52] | [MIT][3] |
45+
| [Maven Deploy Plugin][54] | [The Apache Software License, Version 2.0][39] |
46+
| [Nexus Staging Maven Plugin][56] | [Eclipse Public License][57] |
47+
| [error-code-crawler-maven-plugin][58] | [MIT][3] |
48+
| [Reproducible Build Maven Plugin][60] | [Apache 2.0][39] |
49+
| [Maven Clean Plugin][62] | [The Apache Software License, Version 2.0][39] |
50+
| [Maven Resources Plugin][64] | [The Apache Software License, Version 2.0][39] |
51+
| [Maven JAR Plugin][66] | [The Apache Software License, Version 2.0][39] |
52+
| [Maven Install Plugin][68] | [The Apache Software License, Version 2.0][39] |
53+
| [Maven Site Plugin 3][70] | [The Apache Software License, Version 2.0][39] |
5354

5455
[4]: https://www.eclemma.org/jacoco/index.html
55-
[50]: https://github.com/exasol/project-keeper-maven-plugin
56+
[52]: https://github.com/exasol/project-keeper-maven-plugin
5657
[6]: https://github.com/exasol/bucketfs-java
5758
[2]: https://github.com/exasol/error-reporting-java
5859
[0]: https://javaee.github.io/jsonp
59-
[37]: http://www.apache.org/licenses/LICENSE-2.0.txt
60-
[28]: https://maven.apache.org/surefire/maven-surefire-plugin/
61-
[54]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/
62-
[60]: http://maven.apache.org/plugins/maven-clean-plugin/
60+
[39]: http://www.apache.org/licenses/LICENSE-2.0.txt
61+
[30]: https://maven.apache.org/surefire/maven-surefire-plugin/
62+
[56]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/
63+
[62]: http://maven.apache.org/plugins/maven-clean-plugin/
6364
[3]: https://opensource.org/licenses/MIT
64-
[20]: https://github.com/mockito/mockito
65-
[30]: https://maven.apache.org/surefire/maven-failsafe-plugin/
66-
[36]: http://maven.apache.org/plugins/maven-dependency-plugin/
67-
[38]: http://www.mojohaus.org/versions-maven-plugin/
68-
[34]: https://maven.apache.org/plugins/maven-compiler-plugin/
65+
[22]: https://github.com/mockito/mockito
66+
[32]: https://maven.apache.org/surefire/maven-failsafe-plugin/
67+
[12]: https://github.com/exasol/test-db-builder-java
68+
[10]: https://commons.apache.org/proper/commons-compress/
69+
[38]: http://maven.apache.org/plugins/maven-dependency-plugin/
70+
[40]: http://www.mojohaus.org/versions-maven-plugin/
71+
[36]: https://maven.apache.org/plugins/maven-compiler-plugin/
6972
[1]: https://oss.oracle.com/licenses/CDDL+GPL-1.1
70-
[27]: http://opensource.org/licenses/MIT
71-
[44]: http://maven.apache.org/plugins/maven-gpg-plugin/
73+
[29]: http://opensource.org/licenses/MIT
74+
[46]: http://maven.apache.org/plugins/maven-gpg-plugin/
7275
[5]: https://www.eclipse.org/legal/epl-2.0/
73-
[55]: http://www.eclipse.org/legal/epl-v10.html
74-
[24]: https://github.com/exasol/exasol-testcontainers
75-
[22]: https://github.com/hamcrest/JavaHamcrest/hamcrest-all
76-
[58]: http://zlika.github.io/reproducible-build-maven-plugin
77-
[64]: http://maven.apache.org/plugins/maven-jar-plugin/
78-
[13]: http://www.opensource.org/licenses/mit-license.php
79-
[29]: https://www.apache.org/licenses/LICENSE-2.0.txt
80-
[48]: https://maven.apache.org/enforcer/maven-enforcer-plugin/
81-
[21]: https://github.com/mockito/mockito/blob/release/3.x/LICENSE
82-
[17]: https://www.eclipse.org/legal/epl-v20.html
83-
[23]: http://www.opensource.org/licenses/bsd-license.php
84-
[66]: http://maven.apache.org/plugins/maven-install-plugin/
85-
[16]: https://junit.org/junit5/
86-
[46]: https://sonatype.github.io/ossindex-maven/maven-plugin/
87-
[26]: https://testcontainers.org
88-
[40]: https://maven.apache.org/plugins/maven-source-plugin/
89-
[12]: http://www.slf4j.org
90-
[52]: http://maven.apache.org/plugins/maven-deploy-plugin/
91-
[68]: http://maven.apache.org/plugins/maven-site-plugin/
92-
[62]: http://maven.apache.org/plugins/maven-resources-plugin/
93-
[42]: https://maven.apache.org/plugins/maven-javadoc-plugin/
94-
[56]: https://github.com/exasol/error-code-crawler-maven-plugin
76+
[57]: http://www.eclipse.org/legal/epl-v10.html
77+
[26]: https://github.com/exasol/exasol-testcontainers
78+
[34]: https://www.jacoco.org/jacoco/trunk/doc/maven.html
79+
[24]: https://github.com/hamcrest/JavaHamcrest/hamcrest-all
80+
[23]: https://github.com/mockito/mockito/blob/main/LICENSE
81+
[60]: http://zlika.github.io/reproducible-build-maven-plugin
82+
[66]: http://maven.apache.org/plugins/maven-jar-plugin/
83+
[15]: http://www.opensource.org/licenses/mit-license.php
84+
[11]: https://www.apache.org/licenses/LICENSE-2.0.txt
85+
[50]: https://maven.apache.org/enforcer/maven-enforcer-plugin/
86+
[19]: https://www.eclipse.org/legal/epl-v20.html
87+
[25]: http://www.opensource.org/licenses/bsd-license.php
88+
[68]: http://maven.apache.org/plugins/maven-install-plugin/
89+
[18]: https://junit.org/junit5/
90+
[48]: https://sonatype.github.io/ossindex-maven/maven-plugin/
91+
[28]: https://testcontainers.org
92+
[42]: https://maven.apache.org/plugins/maven-source-plugin/
93+
[14]: http://www.slf4j.org
94+
[54]: http://maven.apache.org/plugins/maven-deploy-plugin/
95+
[70]: http://maven.apache.org/plugins/maven-site-plugin/
96+
[64]: http://maven.apache.org/plugins/maven-resources-plugin/
97+
[44]: https://maven.apache.org/plugins/maven-javadoc-plugin/
98+
[58]: https://github.com/exasol/error-code-crawler-maven-plugin
9599
[8]: https://github.com/exasol/exasol-test-setup-abstraction-java
96-
[10]: https://github.com/exasol/test-db-builder

doc/changes/changes_0.4.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Code name:
66

77
* #15: Add API for host port proxy
88
* #26: Added support for exasol-test-setup-abstraction
9+
* #20: Added module for JProfiler
910

1011
## Refactoring:
1112

pom.xml

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1313
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1414
<java.version>11</java.version>
15-
<junit.version>5.7.1</junit.version>
15+
<junit.version>5.7.2</junit.version>
1616
<junit.platform.version>1.7.1</junit.platform.version>
1717
<vscommon.version>11.0.0</vscommon.version>
1818
<gpg.skip>true</gpg.skip>
19-
<jacoco.version>0.8.6</jacoco.version>
20-
<org.testcontainers.version>1.15.2</org.testcontainers.version>
19+
<jacoco.version>0.8.7</jacoco.version>
20+
<org.testcontainers.version>1.15.3</org.testcontainers.version>
2121
<surefire.and.failsafe.plugin.version>3.0.0-M4</surefire.and.failsafe.plugin.version>
2222
</properties>
2323
<licenses>
@@ -50,26 +50,6 @@
5050
<developerConnection>scm:git:https://github.com/exasol/udf-debugging-java.git</developerConnection>
5151
<url>https://github.com/exasol/udf-debugging-java/tree/master</url>
5252
</scm>
53-
<repositories>
54-
<repository>
55-
<id>maven.exasol.com</id>
56-
<url>https://maven.exasol.com/artifactory/exasol-releases</url>
57-
<snapshots>
58-
<enabled>false</enabled>
59-
</snapshots>
60-
</repository>
61-
<repository>
62-
<id>maven.exasol.com-snapshots</id>
63-
<url>https://maven.exasol.com/artifactory/exasol-snapshots</url>
64-
<snapshots>
65-
<enabled>true</enabled>
66-
</snapshots>
67-
</repository>
68-
<repository>
69-
<id>jitpack.io</id>
70-
<url>https://jitpack.io</url>
71-
</repository>
72-
</repositories>
7353
<dependencies>
7454
<dependency>
7555
<groupId>javax.json</groupId>
@@ -96,12 +76,17 @@
9676
<dependency>
9777
<groupId>com.exasol</groupId>
9878
<artifactId>bucketfs-java</artifactId>
99-
<version>1.0.0</version>
79+
<version>2.0.1</version>
10080
</dependency>
10181
<dependency>
10282
<groupId>com.exasol</groupId>
10383
<artifactId>exasol-test-setup-abstraction-java</artifactId>
104-
<version>0.1.0</version>
84+
<version>0.1.1</version>
85+
</dependency>
86+
<dependency>
87+
<groupId>org.apache.commons</groupId>
88+
<artifactId>commons-compress</artifactId>
89+
<version>1.21</version>
10590
</dependency>
10691
<!-- test dependencies -->
10792
<dependency>
@@ -119,7 +104,7 @@
119104
<dependency>
120105
<groupId>org.mockito</groupId>
121106
<artifactId>mockito-core</artifactId>
122-
<version>3.8.0</version>
107+
<version>3.11.2</version>
123108
<scope>test</scope>
124109
</dependency>
125110
<dependency>
@@ -132,7 +117,7 @@
132117
<dependency>
133118
<groupId>com.exasol</groupId>
134119
<artifactId>exasol-testcontainers</artifactId>
135-
<version>3.5.2</version>
120+
<version>3.5.3</version>
136121
<scope>test</scope>
137122
</dependency>
138123
<dependency>
@@ -144,12 +129,12 @@
144129
<dependency>
145130
<groupId>com.exasol</groupId>
146131
<artifactId>test-db-builder-java</artifactId>
147-
<version>3.1.1</version>
132+
<version>3.2.0</version>
148133
</dependency>
149134
<dependency>
150135
<groupId>org.slf4j</groupId>
151136
<artifactId>slf4j-api</artifactId>
152-
<version>1.7.30</version>
137+
<version>1.7.31</version>
153138
<scope>compile</scope>
154139
</dependency>
155140
</dependencies>
@@ -369,7 +354,7 @@
369354
<plugin>
370355
<groupId>com.exasol</groupId>
371356
<artifactId>project-keeper-maven-plugin</artifactId>
372-
<version>0.9.0</version>
357+
<version>0.10.0</version>
373358
<executions>
374359
<execution>
375360
<goals>

src/main/java/com/exasol/udfdebugging/UdfTestSetup.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
import com.exasol.exasoltestsetup.ServiceAddress;
1212
import com.exasol.udfdebugging.modules.coverage.CoverageModuleFactory;
1313
import com.exasol.udfdebugging.modules.debugging.DebuggingModuleFactory;
14+
import com.exasol.udfdebugging.modules.jprofiler.JProfilerModuleFactory;
1415

1516
/**
1617
* Test setup for testing UDFs in the database.
1718
*/
1819
public class UdfTestSetup {
1920
private static final List<ModuleFactory> AVAILABLE_MODULES = List.of(new DebuggingModuleFactory(),
20-
new CoverageModuleFactory());
21+
new CoverageModuleFactory(), new JProfilerModuleFactory());
2122
private static final Logger LOGGER = LoggerFactory.getLogger(UdfTestSetup.class);
2223
private final List<Module> enabledModules;
2324

src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.exasol.udfdebugging.modules.coverage;
22

3+
import java.io.FileNotFoundException;
34
import java.nio.file.Path;
45
import java.util.concurrent.TimeoutException;
56
import java.util.stream.Stream;
@@ -53,17 +54,10 @@ public Stream<String> getJvmOptions() {
5354
private void uploadAgentToBucketFs(final Bucket bucket) {
5455
try {
5556
bucket.uploadFile(JACOCO_AGENT_PATH, JACOCO_AGENT_NAME);
56-
} catch (final TimeoutException | BucketAccessException exception) {
57-
throw getUploadFailedException(exception);
58-
} catch (final InterruptedException exception) {
59-
Thread.currentThread().interrupt();
60-
throw getUploadFailedException(exception);
57+
} catch (final TimeoutException | BucketAccessException | FileNotFoundException exception) {
58+
throw new IllegalStateException(
59+
ExaError.messageBuilder("E-UDJ-5").message("Failed to upload jacoco agent to BucketFS.").toString(),
60+
exception);
6161
}
6262
}
63-
64-
private IllegalStateException getUploadFailedException(final Exception exception) {
65-
return new IllegalStateException(
66-
ExaError.messageBuilder("E-UDJ-5").message("Failed to upload jacoco agent to BucketFS.").toString(),
67-
exception);
68-
}
6963
}

0 commit comments

Comments
 (0)