revert the mvccStorageBytes for write sample change and mark it with FIXME
This commit is contained in:
parent
62b88a0772
commit
3fb12680e3
|
@ -634,7 +634,7 @@ struct GetShardStateRequest {
|
||||||
struct StorageMetrics {
|
struct StorageMetrics {
|
||||||
constexpr static FileIdentifier file_identifier = 13622226;
|
constexpr static FileIdentifier file_identifier = 13622226;
|
||||||
int64_t bytes = 0; // total storage
|
int64_t bytes = 0; // total storage
|
||||||
int64_t writeBytesPerKSecond = 0; // network bandwidth (average over 10s) == write bandwidth through any IO devices
|
int64_t writeBytesPerKSecond = 0; // bytes write to SQ
|
||||||
|
|
||||||
// FIXME: currently, iosPerKSecond is not used in DataDistribution calculations.
|
// FIXME: currently, iosPerKSecond is not used in DataDistribution calculations.
|
||||||
int64_t iosPerKSecond = 0;
|
int64_t iosPerKSecond = 0;
|
||||||
|
@ -1180,4 +1180,13 @@ struct StorageQueuingMetricsRequest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Memory size for storing mutation in the mutation log and the versioned map.
|
||||||
|
inline int mvccStorageBytes(int mutationBytes) {
|
||||||
|
// Why * 2:
|
||||||
|
// - 1 insertion into version map costs 2 nodes in avg;
|
||||||
|
// - The mutation will be stored in both mutation log and versioned map;
|
||||||
|
return VersionedMap<KeyRef, ValueOrClearToRef>::overheadPerItem * 2 +
|
||||||
|
(mutationBytes + MutationRef::OVERHEAD_BYTES) * 2;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -401,7 +401,8 @@ void MockStorageServer::clearRangeTotalBytes(KeyRangeRef const& range, int64_t b
|
||||||
void MockStorageServer::notifyWriteMetrics(KeyRef const& key, int64_t size) {
|
void MockStorageServer::notifyWriteMetrics(KeyRef const& key, int64_t size) {
|
||||||
// update write bandwidth and iops as mock the cost of writing a mutation
|
// update write bandwidth and iops as mock the cost of writing a mutation
|
||||||
StorageMetrics s;
|
StorageMetrics s;
|
||||||
s.writeBytesPerKSecond = size + MutationRef::OVERHEAD_BYTES;
|
// FIXME: remove the / 2 and double the related knobs.
|
||||||
|
s.writeBytesPerKSecond = mvccStorageBytes(size) / 2;
|
||||||
s.iosPerKSecond = 1;
|
s.iosPerKSecond = 1;
|
||||||
metrics.notify(key, s);
|
metrics.notify(key, s);
|
||||||
}
|
}
|
||||||
|
@ -1000,7 +1001,6 @@ TEST_CASE("/MockGlobalState/MockStorageServer/DataOpsSet") {
|
||||||
// If sampled
|
// If sampled
|
||||||
ASSERT_EQ(res.first.get().bytes, testSize);
|
ASSERT_EQ(res.first.get().bytes, testSize);
|
||||||
ASSERT_GT(res.first.get().writeBytesPerKSecond, 0);
|
ASSERT_GT(res.first.get().writeBytesPerKSecond, 0);
|
||||||
ASSERT_GT(res.first.get().iosPerKSecond, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Void();
|
return Void();
|
||||||
|
|
|
@ -534,12 +534,8 @@ const int VERSION_OVERHEAD =
|
||||||
// createNewVersion(version+1) ], 64b
|
// createNewVersion(version+1) ], 64b
|
||||||
// overhead for map
|
// overhead for map
|
||||||
|
|
||||||
// Memory size for storing mutation in the mutation log and the versioned map.
|
|
||||||
static int mvccStorageBytes(MutationRef const& m) {
|
static int mvccStorageBytes(MutationRef const& m) {
|
||||||
// Why * 2:
|
return mvccStorageBytes(m.param1.size() + m.param2.size());
|
||||||
// - 1 insertion into version map costs 2 nodes in avg;
|
|
||||||
// - The mutation will be stored in both mutation log and versioned map;
|
|
||||||
return VersionedMap<KeyRef, ValueOrClearToRef>::overheadPerItem * 2 + m.totalSize() * 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct FetchInjectionInfo {
|
struct FetchInjectionInfo {
|
||||||
|
@ -5616,7 +5612,8 @@ void applyMutation(StorageServer* self,
|
||||||
// m is expected to be in arena already
|
// m is expected to be in arena already
|
||||||
// Clear split keys are added to arena
|
// Clear split keys are added to arena
|
||||||
StorageMetrics metrics;
|
StorageMetrics metrics;
|
||||||
metrics.writeBytesPerKSecond = m.totalSize(); // comparable to counter.mutationBytes
|
// FIXME: remove the / 2 and double the related knobs.
|
||||||
|
metrics.writeBytesPerKSecond = mvccStorageBytes(m) / 2; // comparable to counter.bytesInput / 2
|
||||||
metrics.iosPerKSecond = 1;
|
metrics.iosPerKSecond = 1;
|
||||||
self->metrics.notify(m.param1, metrics);
|
self->metrics.notify(m.param1, metrics);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue