MCPcopy Create free account
hub / github.com/F-Stack/f-stack / randomizeClientKey

Function randomizeClientKey

app/redis-6.2.6/src/redis-benchmark.c:432–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430}
431
432static void randomizeClientKey(client c) {
433 size_t i;
434
435 for (i = 0; i < c->randlen; i++) {
436 char *p = c->randptr[i]+11;
437 size_t r = 0;
438 if (config.randomkeys_keyspacelen != 0)
439 r = random() % config.randomkeys_keyspacelen;
440 size_t j;
441
442 for (j = 0; j < 12; j++) {
443 *p = '0'+r%10;
444 r/=10;
445 p--;
446 }
447 }
448}
449
450static void setClusterKeyHashTag(client c) {
451 assert(c->thread_id >= 0);

Callers 1

writeHandlerFunction · 0.85

Calls 1

randomFunction · 0.50

Tested by

no test coverage detected