Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improved scenario execution endpoint fetch performance #319

Conversation

bbortt
Copy link
Collaborator

@bbortt bbortt commented Jan 16, 2025

this makes loading ScenarioExecutions "standalone" by default. no additional entities will be fetched without defined query params. wheres previously the whole entity was fetched including all relationships. superfluous information was only stripped afterwards.

the standard sql is:

select se1_0.execution_id,
       se1_0.end_date,
       se1_0.scenario_name,
       se1_0.start_date,
       tr1_0.id,
       tr1_0.class_name,
       tr1_0.created_date,
       tr1_0.error_message,
       tr1_0.failure_type,
       tr1_0.last_modified_date,
       tr1_0.stack_trace,
       tr1_0.status,
       tr1_0.test_name
from scenario_execution se1_0
         left join test_result tr1_0 on tr1_0.id = se1_0.test_result_id
where se1_0.execution_id in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
order by se1_0.execution_id

@bbortt bbortt added IN PROGRESS Type: Maintenance Prio: High java Pull requests that update Java code labels Jan 16, 2025
@bbortt bbortt self-assigned this Jan 16, 2025
improved performance of `/api/scenario-executions` endpoint.
instead of fetching all relationships and then trimming the result,
relationships are now only conditionally being fetched.
@bbortt bbortt force-pushed the fix/scenario-execution-endpoint-performance branch from 15b04ef to 2b54fc9 Compare January 16, 2025 12:49
@bbortt bbortt requested a review from tschlat January 16, 2025 12:51
@bbortt
Copy link
Collaborator Author

bbortt commented Jan 16, 2025

htmlReport.zip

Coverage Breakdown

Package Class, % Method, % Branch, % Line, %
org.citrusframework.simulator 100% (1/1) 50% (4/8) 0% (0/4) 26.7% (8/30)

@bbortt bbortt changed the title Draft: improved scenario execution endpoint fetch performance improved scenario execution endpoint fetch performance Jan 16, 2025
@bbortt bbortt merged commit bcb593c into citrusframework:main Jan 20, 2025
5 checks passed
@bbortt bbortt deleted the fix/scenario-execution-endpoint-performance branch January 20, 2025 07:11
This was referenced Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java Pull requests that update Java code Prio: High TO REVIEW Type: Maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants