### General Info & Setup This script is used to measure the speed of document processing in CouchDB. It sends a request to the CouchDB scheduler endpoint and retrieves information about documents transferred. The script logs the speed (documents per second) into an output CSV file. 1. Run `https://gist.githubusercontent.com/ss186222/2f024da3d7f51c0c61b861bb424dfe33/raw/6dc09ed53872b70e93660f88e29684163131810a/cleanup.sh | bash` to clean the CouchDB cluster. Run this inside your edge-infra folder. 2. Run `kubectl port-forward -n data-sync-couchdb data-sync-couchdb-0 5984:5984` to establish port forwarding. 3. Finally, navigate to hack/datasync/ and run `python3 speedTest.py --maxjobs 10000 --churn 500 --interval 10000 --username USERNAME --password PASSWORD --serverURL http://localhost:PORT/` to start the replication speed test. ### Parameters These are parameters that were set in `./edge-infra/config/pallets/edge/datasync/couchdb/generic/couchdb-server.yaml` - `maxjobs`: Maximum number of jobs parameter value. - `churn`: Churn parameter value. - `interval`: Interval parameter value. - `username`: Username for authentication. - `password`: Password for authentication. - `serverURL`: Server URL (optional, default is "http://localhost:5984/"). - `filterByDatabase`: Filter by specific database ID (optional). ### Output The script appends the following information to the `output.csv` file: - Timestamp - Document ID - Number of documents written - Speed (documents per second) - MaxJobs parameter value - Churn parameter value - Interval parameter value ### Data Analysis The `output.csv` can be analyzed in multiple ways. You can run [this script](https://gist.github.com/ss186222/588ea911d45e03e6326b8c000d7db40d) to perform analysis on the output data and identify the fastest churn/interval/maxJobs pair.