Added options to randomSeeks() in unit test to always get latest version and reinit cursor after each query to closer approximate overhead of using KVS interface.
This commit is contained in:
parent
cab6f7f80d
commit
26c2229ba9
|
@ -9733,14 +9733,28 @@ TEST_CASE("Lredwood/correctness/btree") {
|
||||||
return Void();
|
return Void();
|
||||||
}
|
}
|
||||||
|
|
||||||
ACTOR Future<Void> randomSeeks(VersionedBTree* btree, int count, char firstChar, char lastChar) {
|
ACTOR Future<Void> randomSeeks(VersionedBTree* btree,
|
||||||
state Version readVer = btree->getLastCommittedVersion();
|
Optional<Version> v,
|
||||||
|
bool reInitCursor,
|
||||||
|
int count,
|
||||||
|
char firstChar,
|
||||||
|
char lastChar,
|
||||||
|
int keyLen) {
|
||||||
state int c = 0;
|
state int c = 0;
|
||||||
state double readStart = timer();
|
state double readStart = timer();
|
||||||
state VersionedBTree::BTreeCursor cur;
|
state VersionedBTree::BTreeCursor cur;
|
||||||
|
state Version readVer = v.orDefault(btree->getLastCommittedVersion());
|
||||||
wait(btree->initBTreeCursor(&cur, readVer, PagerEventReasons::PointRead));
|
wait(btree->initBTreeCursor(&cur, readVer, PagerEventReasons::PointRead));
|
||||||
|
|
||||||
while (c < count) {
|
while (c < count) {
|
||||||
state Key k = randomString(20, firstChar, lastChar);
|
if (!v.present()) {
|
||||||
|
readVer = btree->getLastCommittedVersion();
|
||||||
|
}
|
||||||
|
if (reInitCursor) {
|
||||||
|
wait(btree->initBTreeCursor(&cur, readVer, PagerEventReasons::PointRead));
|
||||||
|
}
|
||||||
|
|
||||||
|
state Key k = randomString(keyLen, firstChar, lastChar);
|
||||||
wait(cur.seekGTE(k));
|
wait(cur.seekGTE(k));
|
||||||
++c;
|
++c;
|
||||||
}
|
}
|
||||||
|
@ -10155,7 +10169,8 @@ TEST_CASE(":/redwood/performance/set") {
|
||||||
if (seeks > 0) {
|
if (seeks > 0) {
|
||||||
printf("Parallel seeks, concurrency=%d, seeks=%d ...\n", concurrentSeeks, seeks);
|
printf("Parallel seeks, concurrency=%d, seeks=%d ...\n", concurrentSeeks, seeks);
|
||||||
for (int x = 0; x < concurrentSeeks; ++x) {
|
for (int x = 0; x < concurrentSeeks; ++x) {
|
||||||
actors.add(randomSeeks(btree, seeks / concurrentSeeks, firstKeyChar, lastKeyChar));
|
actors.add(
|
||||||
|
randomSeeks(btree, Optional<Version>(), true, seeks / concurrentSeeks, firstKeyChar, lastKeyChar, 4));
|
||||||
}
|
}
|
||||||
wait(actors.signalAndReset());
|
wait(actors.signalAndReset());
|
||||||
if (!traceMetrics) {
|
if (!traceMetrics) {
|
||||||
|
|
Loading…
Reference in New Issue