Given:
I have multiple engines connected to Optimize and have configured no default tenant for these, and they contain definitions with a tenantId of {{null} (shared definitions)
When:
The report editor loads the definitions from definitionVersionsWithTenants (or from the new equivalent `/api/definition/:type:/keys`)
Then:
The response time is significantly higher (for a test with 1k definitions it was at the magnitude of 10-20 slower) than for a single engine scenario or a scenario where I have default tenants configured per engine.
Expected:
For multi-engine scenarios the response time of the definition endpoints should not increase significantly. The response time should ideally only depend on the number of definitions nothing else.
Hint:
- we also need to validate other potentially affected parts of the application, in particular the cause of the issue is in EngineDefinitionAuthorizationService#filterAuthorizedTenantsForDefinition in terms of the TENANT_NOT_DEFINED handling where each engine/tenant pair is causing a check whether that definition exists for the particular engine
- CollectionService.getCollectionDefinitionsGroupedByVersionAndTenantForType should ideally only fetch the definitions of the scope, currently it fetches all definitions and only then filters by the scope which makes it prone to the same performance bottleneck
AT:
- the performance bottleneck is identified and fixed
- there should be performance tests ensuring acceptable performance of this endpoint going forward
This is the controller panel for Smart Panels app
- is related to
-
OPT-3683 Split Definitions grouped by version and tenant into dedicated endpoints
- Done