MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / randomizeClientKey

Function randomizeClientKey

src/redis-benchmark.cpp:437–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

writeHandlerFunction · 0.70

Calls 1

randomFunction · 0.85

Tested by

no test coverage detected