emit metric
This commit is contained in:
parent
abed367da0
commit
6ab1503fe3
1 changed files with 3 additions and 1 deletions
|
|
@ -119,9 +119,9 @@ public class PrefetchGetRecordsCache implements GetRecordsCache {
|
||||||
log.warn("Prefetch thread was interrupted.");
|
log.warn("Prefetch thread was interrupted.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
MetricsHelper.startScope(metricsFactory, "ProcessTask");
|
||||||
if (prefetchCounters.shouldGetNewRecords()) {
|
if (prefetchCounters.shouldGetNewRecords()) {
|
||||||
try {
|
try {
|
||||||
MetricsHelper.startScope(metricsFactory, "Prefetcheing");
|
|
||||||
GetRecordsResult getRecordsResult = getRecordsRetrievalStrategy.getRecords(maxRecordsPerCall);
|
GetRecordsResult getRecordsResult = getRecordsRetrievalStrategy.getRecords(maxRecordsPerCall);
|
||||||
ProcessRecordsInput processRecordsInput = new ProcessRecordsInput()
|
ProcessRecordsInput processRecordsInput = new ProcessRecordsInput()
|
||||||
.withRecords(getRecordsResult.getRecords())
|
.withRecords(getRecordsResult.getRecords())
|
||||||
|
|
@ -131,6 +131,8 @@ public class PrefetchGetRecordsCache implements GetRecordsCache {
|
||||||
prefetchCounters.added(processRecordsInput);
|
prefetchCounters.added(processRecordsInput);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
log.info("Thread was interrupted, indicating shutdown was called on the cache");
|
log.info("Thread was interrupted, indicating shutdown was called on the cache");
|
||||||
|
} finally {
|
||||||
|
MetricsHelper.endScope();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue