Skip to content

Commit

Permalink
Merge pull request #3741 from atlanhq/task/asyncIndexSearch
Browse files Browse the repository at this point in the history
NOC-87266 | Fix Metric
  • Loading branch information
aarshi0301 authored Nov 14, 2024
2 parents 3293b29 + b0e885b commit e928462
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ private Map<String, Object> runQueryWithLowLevelClient(String query) throws Atla

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

0 comments on commit e928462

Please sign in to comment.