emit metric

This commit is contained in:
Wei 2017-09-29 14:49:11 -07:00
parent abed367da0
commit 6ab1503fe3

View file

@ -119,9 +119,9 @@ public class PrefetchGetRecordsCache implements GetRecordsCache {
log.warn("Prefetch thread was interrupted.");
break;
}
MetricsHelper.startScope(metricsFactory, "ProcessTask");
if (prefetchCounters.shouldGetNewRecords()) {
try {
MetricsHelper.startScope(metricsFactory, "Prefetcheing");
GetRecordsResult getRecordsResult = getRecordsRetrievalStrategy.getRecords(maxRecordsPerCall);
ProcessRecordsInput processRecordsInput = new ProcessRecordsInput()
.withRecords(getRecordsResult.getRecords())
@ -131,6 +131,8 @@ public class PrefetchGetRecordsCache implements GetRecordsCache {
prefetchCounters.added(processRecordsInput);
} catch (InterruptedException e) {
log.info("Thread was interrupted, indicating shutdown was called on the cache");
} finally {
MetricsHelper.endScope();
}
}
}