Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Hoang <[email protected]>
  • Loading branch information
IanHoang committed Sep 30, 2024
1 parent 0fa43f2 commit 8fd60e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions osbenchmark/workload_generator/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ def extract_documents(self, index, documents_limit=None):

total_documents = self.client.count(index=index)["count"]

logger.info("Total documents in index: %s, number of docs user requested: %s", total_documents, documents_limit)

documents_to_extract = total_documents if not documents_limit else min(total_documents, documents_limit)

if documents_limit:
Expand All @@ -191,10 +189,10 @@ def extract_documents(self, index, documents_limit=None):

# Notify users when they specified more documents than available in index
if documents_limit > total_documents:
documents_to_extract_msg = f"User requested to extract {documents_limit} documents " + \
documents_to_extract_warning_msg = f"User requested to extract {documents_limit} documents " + \
f"but there are only {total_documents} documents in {index}. " + \
f"Will only extract {total_documents} documents from {index}."
console.warn(documents_to_extract_msg)
console.warn(documents_to_extract_warning_msg)

if documents_to_extract > 0:
logger.info("[%d] total docs in index [%s]. Extracting [%s] docs.", total_documents, index, documents_to_extract)
Expand Down
2 changes: 1 addition & 1 deletion osbenchmark/workload_generator/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def process_indices(indices, document_frequency, indices_docs_mapping):
processed_indices = []
for index_name in indices:
try:
# Check if user provided number of docs for index
# Setting equal to None means OSB will grab all docs available in index
number_of_docs_for_index = None
if indices_docs_mapping and index_name in indices_docs_mapping:
number_of_docs_for_index = int(indices_docs_mapping[index_name])
Expand Down

0 comments on commit 8fd60e9

Please sign in to comment.