From b9d789ad16820327ae786869eb6e0b6a2d4c993a Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Thu, 30 Nov 2023 13:57:02 +0100 Subject: [PATCH] minimla timing metrics --- src/collective/elastic/ingest/ingest/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/collective/elastic/ingest/ingest/__init__.py b/src/collective/elastic/ingest/ingest/__init__.py index 013ac83..c783042 100644 --- a/src/collective/elastic/ingest/ingest/__init__.py +++ b/src/collective/elastic/ingest/ingest/__init__.py @@ -11,6 +11,7 @@ from .vocabularyfields import stripVocabularyTermTitles from pprint import pformat +import time STATES = {"pipelines_created": False} PIPELINE_PREFIX = "attachment_ingest" @@ -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 @@ -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")