NCMP De-registration Performance test guide
Manual testing with Postman
Build cps-and-ncmp docker image for version to be tested. Run maven from cps repo directory:
mvn clean install -Pcps-ncmp-docker
Edit docker-compose/docker-compose.yml to filter notifications: set NOTIFICATION_DATASPACE_FILTER_PATTERNS to NON-EXISTING-DATASPACE
cps-and-ncmp: environment: notification.enabled: 'true' NOTIFICATION_DATASPACE_FILTER_PATTERNS: 'NON-EXISTING-DATASPACE'
Start docker-compose with DMI plugin stub and monitoring enabled:
docker-compose -f docker-compose/docker-compose.yml --profile dmi-stub --profile monitoring up
Wait for CPS to start. Console output will show:
Test using Postman
Start Postman, and import the NCMP de-register performance postman collection. (This step only needs to be done once.)
Click the new collection, and open the "Variables" tab
Change the current value of TOTAL_CMHANDLES to the desired value, e.g. 10000, and click the "Save" button. This is the number of CM handles that will be registered (and later de-registered).
Select "Register CM handles", and click "Send". (The Postman collection will use a script to automatically create the request body with 10000 CM handles.)
Wait until all CM handles are in READY state. This can take a while, especially with lot of handles.
We can check how many handles are ready by running a query on the database. Here are instructions using the Postgres command line interface (psql), but you may alternatively use the Postgres GUI client.Open a new terminal window, and install postgres-client if needed:
Run psql command to connect to the database (default password is cps):
Run the following query to count the number of handles in the READY state. You will need to repeat this command, until all are ready (e.g. 10000).
Now that all CM handles are ready, we can proceed to test de-registration. Go back to Postman.
In Postman, select "De-Register CM handles", and click "Send".
Record the time taken (54.91 s in this case).
Stop docker-compose:
Clean up docker containers and volumes:
Automated testing
There is a script in the cps repo for automatic testing of NCMP handle de-registration. The script will test registering and de-registering 100, 500, 1000, 5000, 10,000 and 20,000 by default. To use it, simply run the script.
Before testing, you may need to edit docker-compose/docker-compose.yml to filter notifications: set NOTIFICATION_DATASPACE_FILTER_PATTERNS to NON-EXISTING-DATASPACE
Run the script:
While the script is running, you may monitor the progress in another terminal. A summary report will be generated at test-tools/metrics-reports/deregister-summary-{CURRENT-DATETIME}.tsv:
The script will also produce Prometheus metrics reports for each individual test, stored in test-tools/metrics-reports. For example, this report is generated for de-registering 1000 out of 1000 CM handles: deregister-2023-03-24T17:29:20+00:00-1000-1000.tsv