MCPcopy Create free account
hub / github.com/apple/foundationdb / getRandomKey

Function getRandomKey

fdbserver/workloads/ReadWrite.actor.cpp:548–554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546 }
547
548 int64_t getRandomKey(uint64_t nodeCount) {
549 if (forceHotProbability && deterministicRandom()->random01() < forceHotProbability)
550 return deterministicRandom()->randomInt64(0, nodeCount * hotKeyFraction) /
551 hotKeyFraction; // spread hot keys over keyspace
552 else
553 return deterministicRandom()->randomInt64(0, nodeCount);
554 }
555
556 double sweepAlpha(double startTime) {
557 double sweepDuration = testDuration / rampSweepCount;

Callers 9

getRandomKeySelectorMethod · 0.70
_startMethod · 0.70
runTestMethod · 0.70
generateKeyMethod · 0.70
getRandomKeySelectorMethod · 0.70
randomTransactionMethod · 0.70
getRandomKeyMethod · 0.50
RYWIterator.cppFile · 0.50
getRandomKeySelectorMethod · 0.50

Calls 3

deterministicRandomFunction · 0.85
random01Method · 0.80
randomInt64Method · 0.80

Tested by 1

getRandomKeyMethod · 0.40