Skip to content

Commit

Permalink
minimla timing metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Nov 30, 2023
1 parent a255f00 commit b9d789a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/collective/elastic/ingest/ingest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from .vocabularyfields import stripVocabularyTermTitles
from pprint import pformat

import time

STATES = {"pipelines_created": False}
PIPELINE_PREFIX = "attachment_ingest"
Expand Down Expand Up @@ -83,6 +84,7 @@ def ingest(content, full_schema, index_name):
"""

logger.debug(f"Process content: {pformat(content)}")
start = time.time()

# special preprocessing logic for section and vocabulary fields
# TODO: refactor as special preprocessing
Expand Down Expand Up @@ -110,3 +112,4 @@ def ingest(content, full_schema, index_name):
)
logger.debug(f"index kwargs:\n{pformat(kwargs)}")
client.index(**kwargs)
logger.info(f"Indexing of {kwargs['id']} took {(time.time() - start)*1000:0.3f}ms")

0 comments on commit b9d789a

Please sign in to comment.