Skip to content

Commit f3a3492

Browse files
committed
kvserver: takes write and ingested bytes for recordRequestWriteBytes
Previously, recordRequestWriteBytes took a *kvadmission.StoreWriteBytes, which was unnecessary since we're only recording write and ingested bytes, not anything admission control specific. This commit changes the function to accept the raw byte counts directly. This also sets up a future change where follower replicas would not pass in StoreWriteBytes during recording. Epic: none Release note: none
1 parent 597bddc commit f3a3492

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pkg/kv/kvserver/replica_send.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ func (r *Replica) SendWithWriteBytes(
219219
// Record summary throughput information about the batch request for
220220
// accounting.
221221
r.recordBatchRequestLoad(ctx, ba)
222-
r.recordRequestWriteBytes(writeBytes)
222+
if writeBytes != nil {
223+
r.recordRequestWriteBytes(writeBytes.WriteBytes, writeBytes.IngestedBytes)
224+
}
223225
r.recordImpactOnRateLimiter(ctx, br, isReadOnly)
224226
return br, writeBytes, pErr
225227
}
@@ -1067,13 +1069,10 @@ func (r *Replica) getBatchRequestQPS(ctx context.Context, ba *kvpb.BatchRequest)
10671069

10681070
// recordRequestWriteBytes records the write bytes from a replica batch
10691071
// request.
1070-
func (r *Replica) recordRequestWriteBytes(writeBytes *kvadmission.StoreWriteBytes) {
1071-
if writeBytes == nil {
1072-
return
1073-
}
1072+
func (r *Replica) recordRequestWriteBytes(writeBytes int64, ingestedBytes int64) {
10741073
// TODO(kvoli): Consider recording the ingested bytes (AddSST) separately
10751074
// to the write bytes.
1076-
r.loadStats.RecordWriteBytes(float64(writeBytes.WriteBytes + writeBytes.IngestedBytes))
1075+
r.loadStats.RecordWriteBytes(float64(writeBytes + ingestedBytes))
10771076
}
10781077

10791078
// checkBatchRequest verifies BatchRequest validity requirements. In particular,

0 commit comments

Comments
 (0)