mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
redis-cli LRU test mode: randomize value of key when setting.
This way it is possible from an observer to tell when the key is replaced with a new one having the same name.
This commit is contained in:
parent
b8450d7cc5
commit
24dd4a8f04
@ -2424,8 +2424,11 @@ static void LRUTestMode(void) {
|
||||
while(mstime() - start_cycle < 1000) {
|
||||
/* Write cycle. */
|
||||
for (j = 0; j < LRU_CYCLE_PIPELINE_SIZE; j++) {
|
||||
char val[6];
|
||||
val[5] = '\0';
|
||||
for (int i = 0; i < 5; i++) val[i] = 'A'+rand()%('z'-'A');
|
||||
LRUTestGenKey(key,sizeof(key));
|
||||
redisAppendCommand(context, "SET %s val",key);
|
||||
redisAppendCommand(context, "SET %s %s",key,val);
|
||||
}
|
||||
for (j = 0; j < LRU_CYCLE_PIPELINE_SIZE; j++)
|
||||
redisGetReply(context, (void**)&reply);
|
||||
|
Loading…
Reference in New Issue
Block a user