Update documentation
This commit is contained in:
@@ -2,15 +2,57 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
* @brief Test data and utilities for WeaselDB benchmarking and testing.
|
||||
*
|
||||
* This namespace provides pre-defined JSON test data of varying complexity
|
||||
* and utility functions for generating test payloads. The test data is designed
|
||||
* to exercise different aspects of the JSON parsing and commit request
|
||||
* processing pipeline.
|
||||
*/
|
||||
namespace weaseldb::test_data {
|
||||
|
||||
// Sample JSON strings of varying complexity for benchmarking and testing
|
||||
// Declarations only - definitions in test_data.cpp to avoid ODR violations
|
||||
/**
|
||||
* @brief Simple JSON commit request with minimal operations.
|
||||
*
|
||||
* Contains a basic commit request with a single write operation.
|
||||
* Useful for basic functionality testing and performance baseline measurements.
|
||||
*/
|
||||
extern const std::string SIMPLE_JSON;
|
||||
|
||||
/**
|
||||
* @brief Medium complexity JSON commit request.
|
||||
*
|
||||
* Contains multiple operations and preconditions to test parsing
|
||||
* of more realistic commit request structures.
|
||||
*/
|
||||
extern const std::string MEDIUM_JSON;
|
||||
|
||||
/**
|
||||
* @brief Complex JSON commit request with many nested structures.
|
||||
*
|
||||
* Contains extensive preconditions, operations, and edge cases to
|
||||
* thoroughly test parser robustness and performance under load.
|
||||
*/
|
||||
extern const std::string COMPLEX_JSON;
|
||||
|
||||
// Generate a large JSON with many operations for stress testing
|
||||
/**
|
||||
* @brief Generate a large JSON commit request for stress testing.
|
||||
*
|
||||
* Creates a JSON commit request with the specified number of operations
|
||||
* to test parser performance and memory usage under high load conditions.
|
||||
* The generated JSON includes a mix of write, delete, and range operations
|
||||
* with realistic key-value patterns.
|
||||
*
|
||||
* @param num_operations Number of operations to include in the generated JSON
|
||||
* @return JSON string representing a large commit request
|
||||
*
|
||||
* @example
|
||||
* ```cpp
|
||||
* // Generate JSON with 10,000 operations for stress testing
|
||||
* std::string large_json = generate_large_json(10000);
|
||||
* ```
|
||||
*/
|
||||
std::string generate_large_json(int num_operations);
|
||||
|
||||
} // namespace weaseldb::test_data
|
||||
Reference in New Issue
Block a user