@@ -225,6 +225,9 @@ public Optional<DataFileChannel> getDataFileChannel(
225225MetricsSystem .meter (MetricKey .CLIENT_CACHE_BYTES_READ_CACHE .getName ()).mark (bytesToRead );
226226cacheContext .incrementCounter (MetricKey .CLIENT_CACHE_BYTES_READ_CACHE .getMetricName (),BYTE ,
227227bytesToRead );
228+ cacheContext .incrementCounter (
229+ MetricKey .CLIENT_CACHE_PAGE_READ_CACHE_TIME_NS .getMetricName (),NANO ,
230+ System .nanoTime () -startTime );
228231LOG .debug ("getDataChannel({},pageOffset={}) exits" ,pageId ,pageOffset );
229232return Optional .of (dataFileChannel );
230233 }catch (PageNotFoundException e ) {
@@ -242,10 +245,6 @@ public Optional<DataFileChannel> getDataFileChannel(
242245return Optional .empty ();
243246 }
244247 }
245- }finally {
246- cacheContext .incrementCounter (
247- MetricKey .CLIENT_CACHE_PAGE_READ_CACHE_TIME_NS .getMetricName (),NANO ,
248- System .nanoTime () -startTime );
249248 }
250249 }
251250
@@ -642,12 +641,10 @@ public int get(PageId pageId, int pageOffset, int bytesToRead, ReadTargetBuffer
642641MetricsSystem .meter (MetricKey .CLIENT_CACHE_BYTES_READ_CACHE .getName ()).mark (bytesRead );
643642cacheContext .incrementCounter (MetricKey .CLIENT_CACHE_BYTES_READ_CACHE .getMetricName (),BYTE ,
644643bytesRead );
644+ cacheContext .incrementCounter (MetricKey .CLIENT_CACHE_PAGE_READ_CACHE_TIME_NS .getMetricName (),
645+ NANO ,System .nanoTime () -startTime );
645646LOG .debug ("get({},pageOffset={}) exits" ,pageId ,pageOffset );
646647return bytesRead ;
647- }finally {
648- cacheContext .incrementCounter (
649- MetricKey .CLIENT_CACHE_PAGE_READ_CACHE_TIME_NS .getMetricName (),NANO ,
650- System .nanoTime () -startTime );
651648 }
652649 }
653650