Skip to content

Add units (nanoseconds) to HealthCheck. - #2187

Merged
eddumelendez merged 12 commits into
docker-java:mainfrom
SLG:healtcheck_documentation
Oct 26, 2023
Merged

eddumelendez merged 12 commits into
docker-java:mainfrom
SLG:healtcheck_documentation

Conversation

@SLG

@SLG SLG commented Aug 21, 2023

Copy link
Copy Markdown
Contributor

I need to add a manual healtcheck in code. I found the com.github.dockerjava.api.model.HealthCheck:

return new HealthCheck()
                .withTest(Arrays.asList("CMD", "curl", "-f", url))
                .withStartPeriod(SECONDS.toNanos(60))
                .withInterval(SECONDS.toNanos(30))
                .withTimeout(SECONDS.toNanos(30))
                .withRetries(50);

However, I've no idea what the correct unit should be.
I've tried seconds (too small), millis (too small value too), micro (seems to work, but still timing out) and nanos (seems to be the correct one).

@SLG
SLG requested a review from a team as a code owner August 21, 2023 08:41
Comment thread docker-java-api/src/main/java/com/github/dockerjava/api/model/HealthCheck.java Outdated
Comment thread docker-java-api/src/main/java/com/github/dockerjava/api/model/HealthCheck.java Outdated
Comment thread docker-java-api/src/main/java/com/github/dockerjava/api/model/HealthCheck.java Outdated
Comment thread docker-java-api/src/main/java/com/github/dockerjava/api/model/HealthCheck.java Outdated
Comment thread docker-java-api/src/main/java/com/github/dockerjava/api/model/HealthCheck.java Outdated
Comment thread docker-java-api/src/main/java/com/github/dockerjava/api/model/HealthCheck.java Outdated
@eddumelendez

Copy link
Copy Markdown
Member

Hi, Thanks for the PR! Yes, according to the docs is nanoseconds

Screenshot 2023-08-21 at 13 30 39

@eddumelendez eddumelendez added this to the next milestone Aug 21, 2023
Comment thread docker-java-api/src/main/java/com/github/dockerjava/api/model/HealthCheck.java Outdated
Comment thread docker-java-api/src/main/java/com/github/dockerjava/api/model/HealthCheck.java Outdated
Comment thread docker-java-api/src/main/java/com/github/dockerjava/api/model/HealthCheck.java Outdated
@eddumelendez
eddumelendez merged commit d138d51 into docker-java:main Oct 26, 2023
@eddumelendez

Copy link
Copy Markdown
Member

Thanks for your contribution, @SLG !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants