-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add stats healthcheck * Use openjdk-slim * Add banner text * Add example for JVM tool options
- Loading branch information
Showing
6 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
FROM openjdk:21 | ||
FROM openjdk:21-slim | ||
|
||
WORKDIR . | ||
|
||
COPY ./build/peppol-bis-billing-validator--runner.jar . | ||
|
||
ENTRYPOINT ["java", "-Xmx512m", "-jar", "peppol-bis-billing-validator--runner.jar"] | ||
ENTRYPOINT ["java", "-jar", "peppol-bis-billing-validator--runner.jar"] |
This file contains 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
This file contains 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
This file contains 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
41 changes: 41 additions & 0 deletions
41
src/main/java/io/github/easybill/Services/HealthCheck/StatsHealthCheck.java
This file contains 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,41 @@ | ||
package io.github.easybill.Services.HealthCheck; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import java.lang.management.ManagementFactory; | ||
import org.eclipse.microprofile.health.HealthCheck; | ||
import org.eclipse.microprofile.health.HealthCheckResponse; | ||
import org.eclipse.microprofile.health.HealthCheckResponseBuilder; | ||
import org.eclipse.microprofile.health.Liveness; | ||
|
||
@Liveness | ||
@ApplicationScoped | ||
public final class StatsHealthCheck implements HealthCheck { | ||
|
||
@Override | ||
public HealthCheckResponse call() { | ||
HealthCheckResponseBuilder response = HealthCheckResponse.named( | ||
"stats" | ||
); | ||
|
||
var osBean = ManagementFactory.getOperatingSystemMXBean(); | ||
var memBean = ManagementFactory.getMemoryMXBean(); | ||
|
||
return response | ||
.up() | ||
.withData("osName", osBean.getName()) | ||
.withData("osArch", osBean.getArch()) | ||
.withData( | ||
"heapMemoryUsageMax", | ||
memBean.getHeapMemoryUsage().getMax() | ||
) | ||
.withData( | ||
"heapMemoryUsageCommitted", | ||
memBean.getHeapMemoryUsage().getCommitted() | ||
) | ||
.withData( | ||
"heapMemoryUsageUsed", | ||
memBean.getHeapMemoryUsage().getUsed() | ||
) | ||
.build(); | ||
} | ||
} |
This file contains 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,7 @@ | ||
|
||
___. .__.__ .__ | ||
____ _____ _________.__.\_ |__ |__| | | | | ||
_/ __ \\__ \ / ___< | | | __ \| | | | | | ||
\ ___/ / __ \_\___ \ \___ | | \_\ \ | |_| |__ | ||
\___ >____ /____ >/ ____| |___ /__|____/____/ | ||
\/ \/ \/ \/ \/ |