Skip to content

Commit 70b9602

Browse files
committed
Enhance metric
1 parent 791c348 commit 70b9602

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasElasticsearchQuery.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ private Map<String, Object> runQueryWithLowLevelClient(String query) throws Atla
176176

177177
private DirectIndexQueryResult performAsyncDirectIndexQuery(SearchParams searchParams) throws AtlasBaseException, IOException {
178178
AtlasPerfMetrics.MetricRecorder metric = RequestContext.get().startMetricRecord("performAsyncDirectIndexQuery");
179-
AtlasPerfMetrics.MetricRecorder metricSearchTimeout = RequestContext.get().startMetricRecord("asyncDirectIndexQueryTimeout");
180179
DirectIndexQueryResult result = null;
181180
boolean contextIdExists = StringUtils.isNotEmpty(searchParams.getSearchContextId()) && searchParams.getSearchContextSequenceNo() != null;
182181
try {
@@ -209,7 +208,7 @@ private DirectIndexQueryResult performAsyncDirectIndexQuery(SearchParams searchP
209208
// Rather than null (if the response is null wil help returning @204 HTTP_NO_CONTENT to the user)
210209
// return timeout exception to user
211210
LOG.error("timeout exceeded for query {}:", searchParams.getQuery());
212-
RequestContext.get().endMetricRecord(metricSearchTimeout);
211+
RequestContext.get().endMetricRecord(RequestContext.get().startMetricRecord("asyncDirectIndexQueryTimeout"));
213212
throw new AtlasBaseException(AtlasErrorCode.INDEX_SEARCH_FAILED_DUE_TO_TIMEOUT, KeepAliveTime);
214213
}
215214
result = getResultFromResponse(response.getFullResponse(), true);

0 commit comments

Comments
 (0)