From 8fd60e9d55479ee7d0c5c057ede2d449cceccc2c Mon Sep 17 00:00:00 2001 From: Ian Hoang Date: Mon, 30 Sep 2024 14:24:46 -0500 Subject: [PATCH] Small fixes Signed-off-by: Ian Hoang --- osbenchmark/workload_generator/extractors.py | 6 ++---- osbenchmark/workload_generator/helpers.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/osbenchmark/workload_generator/extractors.py b/osbenchmark/workload_generator/extractors.py index fa63ccf6..ebe4dea0 100644 --- a/osbenchmark/workload_generator/extractors.py +++ b/osbenchmark/workload_generator/extractors.py @@ -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: @@ -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) diff --git a/osbenchmark/workload_generator/helpers.py b/osbenchmark/workload_generator/helpers.py index 3956a5b3..c5ca1dc5 100644 --- a/osbenchmark/workload_generator/helpers.py +++ b/osbenchmark/workload_generator/helpers.py @@ -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])