...
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.
Edit docker-compose/docker-compose.yml to filter notifications: set NOTIFICATION_DATASPACE_FILTER_PATTERNS to NON-EXISTING-DATASPACE
Code Block | ||
---|---|---|
| ||
cps-and-ncmp:
environment:
notification.enabled: 'true'
NOTIFICATION_DATASPACE_FILTER_PATTERNS: 'NON-EXISTING-DATASPACE' |
Run the script:
Code Block |
---|
$ ./test-tools/test-deregistration.sh
~/Work/ONAP/cps/cps/test-tools ~/Work/ONAP/cps/cps
Testing deregistration of 100 out of 100 CM handles
Restarting docker
Removing grafana-container ... done
Removing kafka ... done
Removing cps-and-ncmp ... done
Removing zookeeper ... done
Removing dbpostgresql ... done
Removing ncmp-dmi-plugin-stub ... done
Removing prometheus-container ... done
Removing network docker-compose_default
Creating network "docker-compose_default" with the default driver
Creating volume "docker-compose_grafana" with default driver
Creating dbpostgresql ... done
Creating ncmp-dmi-plugin-stub ... done
Creating zookeeper ... done
Creating prometheus-container ... done
Creating kafka ... done
Creating cps-and-ncmp ... done
Creating grafana-container ... done
Waiting for CPS to start
Creating request bodies
[2023-03-24T17:24:19+00:00] Creating CM handles
Waiting for CM handles to be in READY state
There are 0 CM handles in READY state.
There are 100 CM handles in READY state.
Grabbing metrics before deregistration
[2023-03-24T17:25:23+00:00] Removing CM handles
There are 0 CM handles still in READY state.
Grabbing metrics after deregistration
Generating metrics report
Testing deregistration of 500 out of 500 CM handles
Restarting docker
... |
While the script is running, you may monitor the progress in another terminal. The output file will be in test-tools/metrics-reports/deregister-summary-{CURRENT-DATE}.tsv:
Code Block |
---|
$ tail -f test-tools/metrics-reports/deregister-summary-2023-03-24T17\:23\:28+00\:00.tsv
Removed Total Time
100 100 1.099639
500 500 3.452250
1000 1000 6.132099
5000 5000 25.372256 |
The script will additionally produce prometheus metrics for each run, stored in test-tools/metrics-reports, e.g. this report is generated for de-registering 1000 out of 1000 CM handles: deregister-2023-03-24T17:29:20+00:00-1000-1000.tsv