Skip to content

updates deps 23 jul 2025 #450

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# GitHub Copilot Instructions for GCToolKit

## Project Overview
GCToolKit is a Java-based toolkit for analyzing Garbage Collection logs from various JVM implementations. The project uses Maven as its build system and is structured as a multi-module project.

## Architecture & Design Patterns
- **Multi-module Maven project** with clear separation of concerns
- **Event-driven architecture** using Vert.x for message passing
- **Parser framework** for processing various GC log formats
- **Channel-based communication** between parsers and event consumers
- **Verticle pattern** for asynchronous processing with Vert.x

## Module Structure
- `api/` - Core API definitions, interfaces, and base classes
- `parser/` - GC log parsing implementations for different JVM types
- `vertx/` - Vert.x-based messaging and event handling infrastructure
- `sample/` - Example usage and sample applications
- `IT/` - Integration tests
- `gclogs/` - Test data and sample GC logs

## Key Technologies
- **Java 21+** with module system (module-info.java files)
- **Vert.x 5.0.2** for reactive programming and event bus
- **JUnit 5** for testing
- **Maven** for build management
- **Spotbugs, PMD, Checkstyle** for code quality

## Code Style & Conventions
- Follow standard Java naming conventions
- Use proper JavaDoc for public APIs
- Implement equals/hashCode when appropriate
- Use logging with java.util.logging
- Handle exceptions appropriately with try-catch blocks
- Use Promise/Future patterns for asynchronous operations with Vert.x

## Common Patterns in This Codebase

### Event Processing
```java
public void start(Promise<Void> promise) {
vertx.eventBus().<EventType>consumer(inbox, message -> {
processor.receive(message.body());
}).completion()
.onComplete(ar -> promise.complete());
}
```

### Channel Implementation
- Extend appropriate base channel classes
- Implement proper lifecycle management (open/close)
- Use Vert.x deployVerticle for async operations
- Handle deployment IDs for proper cleanup

### Error Handling
- Use java.util.logging.Logger for logging
- Log warnings/errors with proper context
- Handle Future completion with onComplete callbacks

## Vert.x Specific Guidelines
- Use Verticles for isolated processing units
- Deploy verticles asynchronously with completion handlers
- Use the event bus for inter-verticle communication
- Properly manage deployment IDs to avoid double-undeploy issues
- Handle Promise<Void> completion in start() methods

## Testing Conventions
- Integration tests go in the `IT/` module
- Unit tests use JUnit 5
- Test GC log files are stored in `gclogs/` with organized subdirectories
- Mock external dependencies appropriately

## Build & Dependencies
- Maven 3.9.11+ required
- Use the Maven Wrapper (i.e., `mvnw`)
- Keep dependencies up to date, unless you see a comment saying why not to
- Use dependencyManagement in parent POM for version consistency
- Include proper test scopes for test dependencies

## When Suggesting Code Changes
1. Consider the event-driven nature of the architecture
2. Ensure proper async handling with Vert.x patterns
3. Maintain compatibility with existing interfaces
4. Add appropriate logging and error handling
5. Follow the established module boundaries
6. Consider performance implications for GC log processing
7. Ensure proper resource cleanup (channels, verticles, etc.)

## Common Issues to Avoid
- Double-undeployment of Vert.x verticles
- Blocking operations in Vert.x event loops
- Memory leaks from unclosed channels or resources
- Incorrect Promise/Future completion handling
- Missing error handling in async operations

## File Naming Patterns
- Verticles: `*Verticle.java`
- Channels: `*Channel.java`
- Events: `*Event.java`
- Tests: `*Test.java`
- Integration tests: `*IT.java` or in IT module
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar
29 changes: 12 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,40 +45,40 @@

<properties>
<revision>3.0.3-SNAPSHOT</revision>
<checkstyle.version>10.23.0</checkstyle.version>
<jreleaser.plugin.version>1.17.0</jreleaser.plugin.version>
<junit5.version>5.12.2</junit5.version>
<checkstyle.version>10.26.1</checkstyle.version>
<jreleaser.plugin.version>1.19.0</jreleaser.plugin.version>
<junit5.version>5.13.4</junit5.version>
<maven.antrun-plugin.version>3.1.0</maven.antrun-plugin.version>
<maven.changes-plugin.version>3.0.0-M2</maven.changes-plugin.version>
<maven.changes-plugin.version>3.0.0-M3</maven.changes-plugin.version>
<maven.checkstyle-plugin.version>3.6.0</maven.checkstyle-plugin.version>
<maven.clean-plugin.version>3.4.1</maven.clean-plugin.version>
<maven.clean-plugin.version>3.5.0</maven.clean-plugin.version>
<maven.compiler-plugin.version>3.14.0</maven.compiler-plugin.version>
<maven.compiler.release>11</maven.compiler.release>
<maven.dependency-plugin.version>3.8.1</maven.dependency-plugin.version>
<maven.deploy-plugin.version>3.1.4</maven.deploy-plugin.version>
<maven.directory-maven-plugin.version>1.0</maven.directory-maven-plugin.version>
<maven.enforcer-plugin.version>3.5.0</maven.enforcer-plugin.version>
<maven.exec-plugin.version>3.5.0</maven.exec-plugin.version>
<maven.enforcer-plugin.version>3.6.1</maven.enforcer-plugin.version>
<maven.exec-plugin.version>3.5.1</maven.exec-plugin.version>
<maven.install-plugin.version>3.1.4</maven.install-plugin.version>
<maven.jacoco-plugin.version>0.8.13</maven.jacoco-plugin.version>
<maven.jar-plugin.version>3.4.2</maven.jar-plugin.version>
<maven.javadoc-plugin.version>3.11.2</maven.javadoc-plugin.version>
<maven.jxr-plugin.version>3.6.0</maven.jxr-plugin.version>
<maven.license-plugin.version>2.5.0</maven.license-plugin.version>
<!-- TODO Upgrade to 3.26.0+ once we move to PMD 7.8.0+ -->
<maven.license-plugin.version>2.6.0</maven.license-plugin.version>
<!-- TODO Upgrade to 3.27.0+ once we move to PMD 7.8.0+ -->
<maven.pmd-plugin.version>3.21.2</maven.pmd-plugin.version>
<maven.project-info-reports-plugin.version>3.9.0</maven.project-info-reports-plugin.version>
<maven.rat-plugin.version>0.16.1</maven.rat-plugin.version>
<maven.release-plugin.version>3.1.1</maven.release-plugin.version>
<maven.resources-plugin.version>3.3.1</maven.resources-plugin.version>
<maven.site-plugin.version>4.0.0-M16</maven.site-plugin.version>
<maven.source-plugin.version>3.3.1</maven.source-plugin.version>
<maven.spotbugs-plugin.version>4.9.3.0</maven.spotbugs-plugin.version>
<maven.spotbugs-plugin.version>4.9.3.2</maven.spotbugs-plugin.version>
<maven.surefire-plugin.version>3.5.3</maven.surefire-plugin.version>
<maven.version>3.9.9</maven.version>
<maven.version>3.9.11</maven.version>
<maven.versions-plugin.version>2.18.0</maven.versions-plugin.version>
<mutability.detector.version>0.9.1</mutability.detector.version>
<!-- TODO Migrate to 7.9.0+ -->
<!-- TODO Migrate to 7.15.0+ -->
<pmd.version>6.55.0</pmd.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.github.repository>microsoft/gctoolkit</project.github.repository>
Expand Down Expand Up @@ -385,19 +385,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<!-- TODO This configuration is only for when we produce GitHub published reports -->
<configuration>
<githubAPIScheme>https</githubAPIScheme>
<githubAPIPort>443</githubAPIPort>
<includeOpenIssues>false</includeOpenIssues>
<onlyCurrentVersion>false</onlyCurrentVersion>
</configuration>
<reportSets>
<reportSet>
<reports>
<report>changes</report>
<!-- TODO -->
<!-- <report>github-report</report> -->
</reports>
</reportSet>
</reportSets>
Expand Down
2 changes: 1 addition & 1 deletion vertx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>4.5.14</version>
<version>5.0.2</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ public void start(Promise<Void> promise) {
try {
vertx.eventBus().<String>consumer(inbox, message -> {
processor.receive(message.body());
if (GCLogFile.END_OF_DATA_SENTINEL.equals(message.body())) {
vertx.undeploy(id);
}
}).completionHandler(result -> {promise.complete();});
// Removed vertx.undeploy(id) to avoid double-undeploy
}).completion()
.onComplete(ar -> promise.complete());
} catch(Throwable t) {
LOGGER.log(Level.WARNING,"Vertx: processing DataSource failed",t);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,11 @@ public void start(Promise<Void> promise) {
try {
processor.receive(event);
} catch (Throwable t) {
// Throwable is caught because we don't want the processor to blow up the message bus.
LOGGER.log(Level.WARNING, "Vertx: processing JVMEvent failed", t);
}
if (event instanceof JVMTermination) {
vertx.undeploy(id);
}
}).completionHandler(result -> {promise.complete();});
// Removed vertx.undeploy(id) to avoid double-undeploy
}).completion()
.onComplete(ar -> promise.complete());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ protected Vertx vertx() {
* Closes the Vert.x instance.
*/
public void close() {
vertx().close(result -> {
if (result.succeeded()) {
LOGGER.log(Level.FINE, "Vertx: closed");
} else {
LOGGER.log(Level.FINE, "Vertx: close failed", result.cause());
}
});
vertx().close()
.onComplete(ar -> {
if (ar.succeeded()) {
LOGGER.log(Level.FINE, "Vertx: closed");
} else {
LOGGER.log(Level.WARNING, "Vertx: close failed", ar.cause());
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ public VertxDataSourceChannel() {
public void registerListener(DataSourceParser listener) {
final DataSourceVerticle processor = new DataSourceVerticle(vertx(), listener.channel().getName(), listener);
CountDownLatch latch = new CountDownLatch(1);
vertx().deployVerticle(processor, state -> {
processor.setID((state.succeeded()) ? state.result() : "");
latch.countDown();
});
vertx().deployVerticle(processor)
.onComplete(ar -> {
processor.setID(ar.succeeded() ? ar.result() : "");
latch.countDown();
});
try {
latch.await();
} catch (InterruptedException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ public VertxJVMEventChannel() {}
public void registerListener(JVMEventChannelListener listener) {
final JVMEventVerticle processor = new JVMEventVerticle(vertx(), listener.channel().getName(), listener);
CountDownLatch latch = new CountDownLatch(1);
vertx().deployVerticle(processor, state -> {
processor.setID((state.succeeded()) ? state.result() : "");
latch.countDown();
});
vertx().deployVerticle(processor)
.onComplete(ar -> {
processor.setID(ar.succeeded() ? ar.result() : "");
latch.countDown();
});

try {
latch.await();
Expand Down