From d521ce416d7e79562d8c5f5031f0dbfe9a7fdd27 Mon Sep 17 00:00:00 2001 From: Andrew Davison Date: Thu, 17 Oct 2024 14:49:09 +0200 Subject: [PATCH] logging to improve performance of POST /results/ --- .../validation_service/resources/results.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/validation_service_api/validation_service/resources/results.py b/validation_service_api/validation_service/resources/results.py index f4a24ab6..04457d28 100644 --- a/validation_service_api/validation_service/resources/results.py +++ b/validation_service_api/validation_service/resources/results.py @@ -274,7 +274,7 @@ def query_results_summary( @router.post("/results/", response_model=ValidationResult, status_code=status.HTTP_201_CREATED) def create_result(result: ValidationResult, token: HTTPAuthorizationCredentials = Depends(auth)): _check_service_status() - logger.info("Beginning post result") + logger.warning(f"Beginning post result ({datetime.now().isoformat()})") user = User(token, allow_anonymous=False) kg_client = get_kg_client_for_user_account(token) @@ -282,12 +282,15 @@ def create_result(result: ValidationResult, token: HTTPAuthorizationCredentials space = space_from_project_id(result.project_id) activity_log = None + logger.warning(f"Saving outputs ({datetime.now().isoformat()})") for output in as_list(validation_activity.outputs): output.save(kg_client, recursive=False, activity_log=activity_log, space=space) + logger.warning(f"Saving custom_property_sets.data_location ({datetime.now().isoformat()})") if validation_activity.custom_property_sets: validation_activity.custom_property_sets.data_location.save(kg_client, recursive=True, activity_log=activity_log, space=space) + logger.warning(f"Saving ModelValidation object ({datetime.now().isoformat()})") validation_activity.save(kg_client, recursive=False, activity_log=activity_log, space=space) - + logger.warning(f"Returning validation result ({datetime.now().isoformat()})") return ValidationResult.from_kg_object(validation_activity, kg_client)