Add range reads to ServerBench
All checks were successful
Tests / Clang total: 1479, passed: 1479
Clang |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Tests / Debug total: 1477, passed: 1477
Tests / SIMD fallback total: 1479, passed: 1479
Tests / Release [gcc] total: 1479, passed: 1479
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Tests / Release [gcc,aarch64] total: 1102, passed: 1102
Tests / Coverage total: 1111, passed: 1111
Code Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 99.60% (1739/1746)
* Branch Coverage: 64.95% (1492/2297)
* Complexity Density: 0.00
* Lines of Code: 1746
#### Quality Gates Summary
Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
All checks were successful
Tests / Clang total: 1479, passed: 1479
Clang |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Tests / Debug total: 1477, passed: 1477
Tests / SIMD fallback total: 1479, passed: 1479
Tests / Release [gcc] total: 1479, passed: 1479
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Tests / Release [gcc,aarch64] total: 1102, passed: 1102
Tests / Coverage total: 1111, passed: 1111
Code Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 99.60% (1739/1746)
* Branch Coverage: 64.95% (1492/2297)
* Complexity Density: 0.00
* Lines of Code: 1746
#### Quality Gates Summary
Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
This commit is contained in:
@@ -31,23 +31,38 @@ std::basic_string<uint8_t> numToKey(int64_t num) {
|
|||||||
|
|
||||||
void workload(weaselab::ConflictSet *cs) {
|
void workload(weaselab::ConflictSet *cs) {
|
||||||
int64_t version = kWindowSize;
|
int64_t version = kWindowSize;
|
||||||
|
cs->addWrites(nullptr, 0, version);
|
||||||
for (;; transactions.fetch_add(1, std::memory_order_relaxed)) {
|
for (;; transactions.fetch_add(1, std::memory_order_relaxed)) {
|
||||||
// Read
|
// Reads
|
||||||
{
|
{
|
||||||
auto rv = version - kWindowSize + rand() % kWindowSize;
|
auto beginK = numToKey(version - kWindowSize);
|
||||||
auto k = numToKey(rv);
|
auto endK = numToKey(version - 1);
|
||||||
weaselab::ConflictSet::ReadRange r;
|
auto pointRv = version - kWindowSize + rand() % kWindowSize + 1;
|
||||||
r.begin.p = k.data();
|
auto pointK = numToKey(pointRv);
|
||||||
r.begin.len = k.size();
|
weaselab::ConflictSet::ReadRange reads[] = {
|
||||||
r.end.len = 0;
|
{
|
||||||
r.readVersion = rv;
|
{pointK.data(), int(pointK.size())},
|
||||||
weaselab::ConflictSet::Result result;
|
{nullptr, 0},
|
||||||
cs->check(&r, &result, 1);
|
pointRv,
|
||||||
if (result != weaselab::ConflictSet::Commit) {
|
},
|
||||||
abort();
|
{
|
||||||
}
|
{beginK.data(), int(beginK.size())},
|
||||||
|
{endK.data(), int(endK.size())},
|
||||||
|
version - 2,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
weaselab::ConflictSet::Result result[sizeof(reads) / sizeof(reads[0])];
|
||||||
|
cs->check(reads, result, sizeof(reads) / sizeof(reads[0]));
|
||||||
|
// for (int i = 0; i < sizeof(reads) / sizeof(reads[0]); ++i) {
|
||||||
|
// if (result[i] != weaselab::ConflictSet::Commit) {
|
||||||
|
// fprintf(stderr, "Unexpected conflict: [%s, %s) @ %" PRId64 "\n",
|
||||||
|
// printable(reads[i].begin).c_str(),
|
||||||
|
// printable(reads[i].end).c_str(), reads[i].readVersion);
|
||||||
|
// abort();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
// Write
|
// Writes
|
||||||
{
|
{
|
||||||
weaselab::ConflictSet::WriteRange w;
|
weaselab::ConflictSet::WriteRange w;
|
||||||
auto k = numToKey(version);
|
auto k = numToKey(version);
|
||||||
|
Reference in New Issue
Block a user