Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Commit

Permalink
Reformat Startup message, allow to run on non HotSpot VMs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcust committed Oct 3, 2018
1 parent ea6a845 commit 738fea4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions jzenith-core/src/main/java/org/jzenith/core/JZenith.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@
import org.jzenith.core.tracing.OpenTracingInterceptor;
import org.jzenith.core.util.CompletableHandler;

import java.lang.management.ManagementFactory;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;

public class JZenith {
Expand Down Expand Up @@ -144,7 +146,8 @@ public JZenith run() {
throw new JZenithException(e);
}

log.debug("jZenith startup complete after {}", stopwatch);
log.debug("jZenith startup complete after {}ms (JVM has been up for {}ms)",
stopwatch.elapsed(TimeUnit.MILLISECONDS), ManagementFactory.getRuntimeMXBean().getUptime());

return this;
}
Expand Down Expand Up @@ -189,7 +192,7 @@ protected void configure() {

Stream.of(Single.class, Observable.class, Completable.class, Maybe.class)
.forEach(clz ->
bindInterceptor(Matchers.any(), Matchers.returns(Matchers.subclassesOf(clz)), interceptor));
bindInterceptor(Matchers.any(), Matchers.returns(Matchers.subclassesOf(clz)), interceptor));
bind(Tracer.class).toInstance(tracer);
}

Expand All @@ -212,7 +215,11 @@ private void initMeterRegistry() {
new JvmGcMetrics().bindTo(registry);
new ProcessorMetrics().bindTo(registry);
new JvmThreadMetrics().bindTo(registry);
new JvmOptionMetrics().bindTo(registry);
try {
new JvmOptionMetrics().bindTo(registry);
} catch (IllegalArgumentException e) {
log.debug("Not running on HotSpot");
}
}

@SafeVarargs
Expand Down

0 comments on commit 738fea4

Please sign in to comment.