@@ -435,6 +435,7 @@ struct StorageServerDisk {
435435 // The following are pointers to the Counters in StorageServer::counters of the same names.
436436 Counter* kvCommitLogicalBytes;
437437 Counter* kvClearRanges;
438+ Counter* kvClearSingleKey;
438439 Counter* kvGets;
439440 Counter* kvScans;
440441 Counter* kvCommits;
@@ -1172,6 +1173,8 @@ struct StorageServer : public IStorageMetricsService {
11721173 Counter kvCommitLogicalBytes;
11731174 // Count of all clearRange operatons to the storage engine.
11741175 Counter kvClearRanges;
1176+ // Count of all clearRange operations on a singlekeyRange(key delete) to the storage engine.
1177+ Counter kvClearSingleKey;
11751178 // ClearRange operations issued by FDB, instead of from users, e.g., ClearRange operations to remove a shard
11761179 // from a storage server, as in removeDataRange().
11771180 Counter kvSystemClearRanges;
@@ -1247,8 +1250,8 @@ struct StorageServer : public IStorageMetricsService {
12471250 feedVersionQueries(" FeedVersionQueries" , cc), bytesInput(" BytesInput" , cc),
12481251 logicalBytesInput(" LogicalBytesInput" , cc), logicalBytesMoveInOverhead(" LogicalBytesMoveInOverhead" , cc),
12491252 kvCommitLogicalBytes(" KVCommitLogicalBytes" , cc), kvClearRanges(" KVClearRanges" , cc),
1250- kvSystemClearRanges( " KVSystemClearRanges " , cc), bytesDurable( " BytesDurable " , cc),
1251- bytesFetched(" BytesFetched" , cc), mutationBytes(" MutationBytes" , cc),
1253+ kvClearSingleKey( " KVClearSingleKey " , cc), kvSystemClearRanges( " KVSystemClearRanges " , cc),
1254+ bytesDurable( " BytesDurable " , cc), bytesFetched(" BytesFetched" , cc), mutationBytes(" MutationBytes" , cc),
12521255 feedBytesFetched(" FeedBytesFetched" , cc), sampledBytesCleared(" SampledBytesCleared" , cc),
12531256 kvFetched(" KVFetched" , cc), mutations(" Mutations" , cc), setMutations(" SetMutations" , cc),
12541257 clearRangeMutations(" ClearRangeMutations" , cc), atomicMutations(" AtomicMutations" , cc),
@@ -1431,6 +1434,7 @@ struct StorageServer : public IStorageMetricsService {
14311434
14321435 this ->storage .kvCommitLogicalBytes = &counters.kvCommitLogicalBytes ;
14331436 this ->storage .kvClearRanges = &counters.kvClearRanges ;
1437+ this ->storage .kvClearSingleKey = &counters.kvClearSingleKey ;
14341438 this ->storage .kvGets = &counters.kvGets ;
14351439 this ->storage .kvScans = &counters.kvScans ;
14361440 this ->storage .kvCommits = &counters.kvCommits ;
@@ -9703,6 +9707,9 @@ void setAssignedStatus(StorageServer* self, KeyRangeRef keys, bool nowAssigned)
97039707void StorageServerDisk::clearRange (KeyRangeRef keys) {
97049708 storage->clear (keys, &data->metrics );
97059709 ++(*kvClearRanges);
9710+ if (keys.singleKeyRange ()) {
9711+ ++(*kvClearSingleKey);
9712+ }
97069713}
97079714
97089715void StorageServerDisk::writeKeyValue (KeyValueRef kv) {
@@ -9717,6 +9724,9 @@ void StorageServerDisk::writeMutation(MutationRef mutation) {
97179724 } else if (mutation.type == MutationRef::ClearRange) {
97189725 storage->clear (KeyRangeRef (mutation.param1 , mutation.param2 ), &data->metrics );
97199726 ++(*kvClearRanges);
9727+ if (KeyRangeRef (mutation.param1 , mutation.param2 ).singleKeyRange ()) {
9728+ ++(*kvClearSingleKey);
9729+ }
97209730 } else
97219731 ASSERT (false );
97229732}
@@ -9732,6 +9742,9 @@ void StorageServerDisk::writeMutations(const VectorRef<MutationRef>& mutations,
97329742 } else if (m.type == MutationRef::ClearRange) {
97339743 storage->clear (KeyRangeRef (m.param1 , m.param2 ), &data->metrics );
97349744 ++(*kvClearRanges);
9745+ if (KeyRangeRef (m.param1 , m.param2 ).singleKeyRange ()) {
9746+ ++(*kvClearSingleKey);
9747+ }
97359748 }
97369749 }
97379750}
0 commit comments