From e3064f77734922b8f06dd3b9380dd8203b6b9bf3 Mon Sep 17 00:00:00 2001 From: Henning Andersen Date: Fri, 26 Jan 2024 09:16:51 +0100 Subject: [PATCH] Add decay time logging --- .../blobcache/shared/SharedBlobCacheService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBlobCacheService.java b/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBlobCacheService.java index f89285ae61cc0..cecd03265e068 100644 --- a/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBlobCacheService.java +++ b/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBlobCacheService.java @@ -1548,7 +1548,11 @@ public boolean maybeEvictLeastUsed() { } private void computeDecay() { + long now = System.currentTimeMillis(); + long afterLock; + long end; synchronized (SharedBlobCacheService.this) { + afterLock = System.currentTimeMillis(); appendLevel1ToLevel0(); for (int i = 2; i < maxFreq; i++) { assert freqs[i - 1] == null; @@ -1558,6 +1562,8 @@ private void computeDecay() { assert freqs[i - 1] == null || invariant(freqs[i - 1], true); } } + end = System.currentTimeMillis(); + logger.info("Decay took {} ms (acquire lock: {} ms)", end-now, afterLock-now); } class DecayAndNewEpochTask extends AbstractRunnable {