Skip to content

Commit

Permalink
Few updates based on PR review.
Browse files Browse the repository at this point in the history
Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
  • Loading branch information
spericas committed Jan 15, 2025
1 parent 3cf18a1 commit 7cfbcc2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/se/fault-tolerance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ the application developer or automatically by the API.
|===
^|Name ^|Tags ^|Description
|ft.bulkhead.calls.total | name="<bulkhead-name>" | Counter for all calls entering a bulkhead
|ft.bulkhead.waitingDuration | name="<bulkhead-name>" | Histogram of waiting times to enter a bulkhead
|ft.bulkhead.waitingDuration | name="<bulkhead-name>" | Distribution summary of waiting times to enter a bulkhead
|ft.bulkhead.executionsRunning | name="<bulkhead-name>" | Gauge whose value is the number of executions running in a bulkhead
|ft.bulkhead.executionsWaiting | name="<bulkhead-name>" | Gauge whose value is the number of executions waiting in a bulkhead
|===
Expand All @@ -304,7 +304,7 @@ closed to open state
|===
^|Name ^|Tags ^|Description
|ft.timeout.calls.total | name="<timeout-name>" | Counter for all calls entering a timeout
|ft.timeout.executionDuration | name="<timeout-name>" | Histogram of all execution durations in a timeout
|ft.timeout.executionDuration | name="<timeout-name>" | Distribution summary of all execution durations in a timeout
|===
=== Enabling Metrics Programmatically
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025 Oracle and/or its affiliates.
* Copyright (c) 2020, 2025 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ public <T> T invoke(Supplier<? extends T> supplier) {
long start = metricsEnabled ? System.nanoTime() : 0L;
if (!currentThread) {
try {
T res = CompletableFuture.supplyAsync(supplier, executor)
return CompletableFuture.supplyAsync(supplier, executor)
.orTimeout(timeoutMillis, TimeUnit.MILLISECONDS)
.get();
} catch (Throwable t) {
throw mapThrowable(t, null);
} finally {
if (metricsEnabled) {
executionDurationMetric.record(System.nanoTime() - start, TimeUnit.NANOSECONDS);
}
return res;
} catch (Throwable t) {
throw mapThrowable(t, null);
}
} else {
Thread thisThread = Thread.currentThread();
Expand Down

0 comments on commit 7cfbcc2

Please sign in to comment.