Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal
With these changes it should be possible to define comprehensive performance tests for any part of the CAP library functionalities. By defining scenarios based upon the
SFlight
example application.Mechanism
The basis of the performance test is
cds w
with a customserver.js
file which exposes an/config
endpoint which can be used to change the.cdsrc.json
file. Which triggerscds w
to restart theSFlight
application with the newly defined configurations. Which is used by thejest
tests to configure the application before starting the test scenarios. All requests send to the application are tracked and can consume thetrace
middleware results for more detailed performance analysis.Adapters
To be able to run the exact same scenario with different adapters (odata, rest, graphql). The tests use
CQN
to create the corresponding end point calls. So when a new adapter is supported it would be possible to run the same scenarios with that adapter after adding theexec
function implementation to the performance test suite.Databases
For the possibility of testing all the different database implementation it is required to ensure that the dependencies are installed before calling
cds w
. This is especially important when deploying the application as only the defined dependencies will be installed. Additionally it is required to configure all service bindings for the database implementations that are going to be tested. As changing the configurations will only restart the application and not re deploy the application with new bindings. This is an intentional behavior as deploying the application takes more time and it might be deployed to different physical hardware which might impact the measured results.Scenarios
Currently a very simple scenario is included where users slowly scroll down the landing page as this is a request that every user needs to make before doing anything else with the
SFlight
application. To add more scenarios it will be required to define moreactions
that users could perform with theSFlight
application. This is done by manually going through the steps in the application and taking the requests send by the application and translating them to theCQN
format. Which will allow the tests to use these actions and create more complex scenarios. It is important that the scenarios are reproducible to reduce variance between executions.Result
Here is an example of how the measurement results look like:
{scenario}
{load} ({nr} users)
To Do
/package.json