Commit 24dd4a8f authored by antirez's avatar antirez
Browse files

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.
parent b8450d7c
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment