Skip to content

Commit 8cc676f

Browse files
committed
Use more plausible JSON placeholder
1 parent 1fe0620 commit 8cc676f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

benchmarks/load_test.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ void init_text_request(int size, BenchmarkConfig *config) {
108108
* @param config Pointer to the BenchmarkConfig to populate
109109
*/
110110
void init_deflated_request(int size, BenchmarkConfig *config) {
111-
static const char placeholder[] = "{\"placeholder\":\"An elaborate placeholder with lots of data\",\"description\":\"A longer piece of text that is used to pad out the JSON to around 300 bytes, containing random info about a user profile.\",\"company\":\"Contoso\",\"address\":{\"street\":\"One Microsoft Way\",\"city\":\"Redmond\",\"state\":\"WA\",\"zip\":\"98052\"},\"skills\":[\"C\",\"C++\",\"Rust\",\"Go\",\"JavaScript\"],\"projects\":[{\"name\":\"SampleProject\",\"linesOfCode\":1234},{\"name\":\"AnotherProject\",\"linesOfCode\":2345}],\"misc\":{\"favoriteQuotes\":[\"Hello World\",\"Lorem Ipsum\",\"Carpe Diem\"]}}";
111+
const char placeholder[] = "{\"userId\":12345,\"action\":\"purchase\",\"items\":[{\"id\":\"A1B2C3\",\"name\":\"Wireless Mouse\",\"price\":25.99,\"quantity\":1},{\"id\":\"D4E5F6\",\"name\":\"Mechanical Keyboard\",\"price\":89.99,\"quantity\":1}],\"payment\":{\"method\":\"credit_card\",\"transactionId\":\"XYZ987654321\",\"status\":\"approved\"},\"timestamp\":\"2025-02-20T15:30:00Z\"};";
112112
char *json_message = malloc(size);
113113
int placeholder_len = sizeof(placeholder) - 1;
114+
printf("Using placeholder of %d bytes\n", placeholder_len);
114115
for (int i = 0; i < size; i += placeholder_len) {
115116
int copy_len = (i + placeholder_len <= size) ? placeholder_len : size - i;
116117
memcpy(json_message + i, placeholder, copy_len);

0 commit comments

Comments
 (0)