Skip to content

Commit ac0d578

Browse files
committed
asim: correct workload usage approximation
Writes also consume the configured request access CPU. The code was written under the assumption that only reads would.
1 parent 56a5f7e commit ac0d578

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/kv/kvserver/asim/tests/datadriven_simulation_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ func TestDataDriven(t *testing.T) {
232232
// Catch tests that set unrealistically small or unrealistically large
233233
// CPU consumptions. This isn't exact because it doesn't account for
234234
// replication, but it's close enough.
235-
approxVCPUs := (rate * (float64(requestCPUPerAccess)*rwRatio + float64(raftCPUPerAccess)*(1.0-rwRatio))) / 1e9
235+
// NB: writes also consume requestCPUPerAccess.
236+
approxVCPUs := (rate * (float64(requestCPUPerAccess) + float64(raftCPUPerAccess)*(1.0-rwRatio))) / 1e9
236237
// Ditto for writes. Here too we don't account for replication. Note
237238
// that at least under uniform writes, real clusters can have a write
238239
// amp that easily surpasses 20, so writing at 40mb/s to a small set

0 commit comments

Comments
 (0)