Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
Signed-off-by: Yury-Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand committed Nov 11, 2023
1 parent 7e712e1 commit 354c7de
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,16 @@ public String get(String key) {
*/
}

// don't delete it otherwise java compiler will optimize next func and GET_FUTURE_RESULT_AFTER_SET will be always negative o_O
private int counter = 0;

@Override
public <T> T waitForResult(Future<T> future) {
long before = System.nanoTime();
var res = AsyncClient.super.waitForResult(future);
long after = System.nanoTime();
WAIT_FOR_RESULT.addAndGet(after - before);
counter++;
GET_FUTURE_RESULT_AFTER_SET.addAndGet(after);
return res;
}
Expand Down

0 comments on commit 354c7de

Please sign in to comment.