This Python script is designed to streamline the creation of Cohort Data Format (CDF) JSON files for load-testing purposes, particularly aimed at evaluating queries and data transformations' performance. The script automates the generation of CDF files with unique identifiers, leveraging sample templates stored in a dedicated directory.
- Unique Identifiers: Each generated CDF file is assigned a unique identifier, ensuring distinctiveness among the test datasets.
- Template-Based Generation: The content of the generated CDF files is derived from sample templates located in the
./samples
directory. This approach allows users to tailor the characteristics of the dummy samples by modifying or adding new templates accordingly.
To utilize this script effectively, follow these steps:
- Prepare Sample Templates: Place your sample CDF templates in the
./samples
folder. Ensure these templates reflect the desired characteristics for your testing scenarios. - Execute the Script: Run the script from the command line, specifying the number of files to generate and the output directory. For example:
This command instructs the script to generate 10 CDF files in the
python script.py 10 ./test_cdfs
./test_cdfs
directory.
To tailor the generated CDF files to specific testing requirements, modify the sample templates in the ./samples
folder. By adjusting these templates, you can control the
structure and content of the generated files, thereby simulating various data scenarios for performance testing.