Using dd-stats zerobytes const in the workload

This commit is contained in:
Chaoguang Lin 2020-05-18 11:53:26 -07:00
parent 117ed14321
commit 6e684dda35
2 changed files with 2 additions and 3 deletions

View File

@ -325,9 +325,8 @@ ACTOR Future<Standalone<RangeResultRef>> ddStatsGetRangeActor(Reference<ReadYour
KeyRef beginKey = ddMetricsRef.beginKey.withPrefix(ddStatsRange.begin, result.arena());
KeyRef endKey = ddMetricsRef.endKey.withPrefix(ddStatsRange.begin, result.arena());
ValueRef bytes(result.arena(), std::to_string(ddMetricsRef.shardBytes));
ValueRef zeroBytes(result.arena(), std::to_string(0));
result.push_back(result.arena(), KeyValueRef(beginKey, bytes));
result.push_back(result.arena(), KeyValueRef(endKey, zeroBytes));
result.push_back(result.arena(), KeyValueRef(endKey, ddStatsZeroBytes));
}
return result;
} catch (Error& e) {

View File

@ -80,7 +80,7 @@ struct DataDistributionMetricsWorkload : KVWorkload {
ASSERT(result[i].key.startsWith(ddStatsRange.begin));
totalBytes += std::stoi(result[i].value.toString());
ASSERT(result[i+1].key.startsWith(ddStatsRange.begin));
ASSERT(std::stoi(result[i+1].value.toString()) == 0);
ASSERT(result[i+1].value == ddStatsZeroBytes);
}
self->avgBytes = totalBytes / self->numShards;
} catch (Error& e) {