-// unfinished load testing utility for Citadel Server
+// Load testing utility for Citadel Server
//
// Copyright (c) 1987-2023 by the citadel.org team
//
char *test_user = "Load Test User";
char test_pass[16];
+
+// These are our randomized load test operations: an even mix of changing rooms, posting messages, and deleting messages.
void perform_random_thing(int serv_sock) {
int op = random() % 3;
char buf[SIZ];
}
+// This is the main loop. We log in as the load test user, and then perform random operations until stopped.
void *loadtest(void *blah) {
char buf[SIZ];
int serv_sock;
serv_puts(serv_sock, buf);
serv_gets(serv_sock, buf);
+ // Find a nice spot on the screen to show the operation count for this thread.
int row = 10 + ((serv_sock-3) % 20);
int col = ((serv_sock-3) / 20) * 10;
long ops = 0;
}
+// Create (or replace) the account used for load testing, then create the rooms in which we will load test.
void setup_accounts(int serv_sock) {
int i;
char buf[SIZ];
exit(errno);
}
- // Generate random password for load test user
+ // Generate a random password for load test user. No one needs this password except us.
srand(time(NULL)+getpid());
for (i=0; i<sizeof(test_pass)-1; ++i) {
test_pass[i] = (rand() % 74) + 48;