Skip to content

Commit

Permalink
change log level on search timing messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kim committed Jan 11, 2025
1 parent bcebd43 commit c73763e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-
-->
------
## [v8.1.0](https://github.com/asfadmin/Discovery-asf_search/compare/v8.0.1...v8.1.0)
### Changed
- Changed log level from warning to debug/info for search timing log messages

------
## [v8.0.1](https://github.com/asfadmin/Discovery-asf_search/compare/v8.0.0...v8.0.1)
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion asf_search/search/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def search(
# The last page will be marked as complete if results sucessful
perf = time.time()
for page in search_generator(opts=opts):
ASF_LOGGER.warning(f'Page Time Elapsed {time.time() - perf}')
ASF_LOGGER.debug(f'Page Time Elapsed {time.time() - perf}')
results.extend(page)
results.searchComplete = page.searchComplete
results.searchOptions = page.searchOptions
Expand Down
6 changes: 3 additions & 3 deletions asf_search/search/search_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def search_generator(
last_page = process_page(
items, maxResults, subquery_max_results, total, subquery_count, opts
)
ASF_LOGGER.warning(f'Page Processing Time {time.time() - perf}')
ASF_LOGGER.log(f'Page Processing Time {time.time() - perf}')
subquery_count += len(last_page)
total += len(last_page)
last_page.searchComplete = subquery_count == subquery_max_results or total == maxResults
Expand Down Expand Up @@ -296,7 +296,7 @@ def query_cmr(

perf = time.time()
items = [as_ASFProduct(f, session=session) for f in response.json()['items']]
ASF_LOGGER.warning(f'Product Subclassing Time {time.time() - perf}')
ASF_LOGGER.debug(f'Product Subclassing Time {time.time() - perf}')
hits: int = response.json()['hits'] # total count of products given search opts
# 9-10 per process
# 3.9-5 per process
Expand Down Expand Up @@ -354,7 +354,7 @@ def get_page(session: ASFSession, url: str, translated_opts: List) -> Response:
f'Connection Error (Timeout): CMR took too long to respond. Set asf constant "asf_search.constants.INTERNAL.CMR_TIMEOUT" to increase. ({url=}, timeout={CMR_TIMEOUT})'
) from exc

ASF_LOGGER.warning(f'Query Time Elapsed {time.time() - perf}')
ASF_LOGGER.log(f'Query Time Elapsed {time.time() - perf}')
return response


Expand Down

0 comments on commit c73763e

Please sign in to comment.