Skip to content

Commit c0b15a2

Browse files
committed
asim: output test set up if eval has full = true
This commit adds an optional parameter to eval that outputs the test setup. By default, the setup is only written to the generated folder as {TESTNAME}_setup.txt.
1 parent 98b475f commit c0b15a2

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ func TestDataDriven(t *testing.T) {
444444
return ""
445445
case "eval":
446446
samples := 1
447+
full := false
447448
// We use a fixed seed to ensure determinism in the simulated data.
448449
// Multiple samples can be used for more coverage.
449450
seed := int64(42)
@@ -460,6 +461,7 @@ func TestDataDriven(t *testing.T) {
460461
scanIfExists(t, d, "seed", &seed)
461462
scanIfExists(t, d, "cfgs", &cfgs)
462463
scanIfExists(t, d, "metrics", &metrics)
464+
scanIfExists(t, d, "full", &full)
463465

464466
t.Logf("running eval for %s", name)
465467

@@ -586,6 +588,10 @@ func TestDataDriven(t *testing.T) {
586588
})
587589
}
588590
writeStateStrToFile(t, filepath.Join(plotDir, fmt.Sprintf("%s_setup.txt", name)), stateStrForOnce, rewrite)
591+
if full {
592+
_, _ = fmt.Fprintf(&buf, stateStrForOnce)
593+
_, _ = fmt.Fprintf(&buf, "==========================\n")
594+
}
589595
return buf.String()
590596
case "assertion":
591597
var stat string

pkg/kv/kvserver/asim/tests/testdata/non_rand/mma_skewed_cpu_skewed_write.txt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ gen_load rate=20000 rw_ratio=0 min_block=1000 max_block=1000 raft_cpu_per_write=
3636
setting split_queue_enabled=false
3737
----
3838

39-
eval duration=60m samples=1 seed=42 cfgs=(mma-only,mma-and-count) metrics=(cpu,write_bytes_per_second,replicas,leases)
39+
eval duration=60m samples=1 seed=42 cfgs=(mma-only,mma-and-count) metrics=(cpu,write_bytes_per_second,replicas,leases) full=true
4040
----
4141
cpu#1: last: [s1=83373599, s2=82955301, s3=83154536, s4=83182126, s5=83144874, s6=84444013] (stddev=492899.15, mean=83375741.50, sum=500254449)
4242
leases#1: first: [s1=36, s2=0, s3=0, s4=36, s5=0, s6=0] (stddev=16.97, mean=12.00, sum=72)
@@ -54,3 +54,23 @@ replicas#1: last: [s1=36, s2=36, s3=33, s4=38, s5=37, s6=36] (stddev=1.53, mean
5454
write_bytes_per_second#1: last: [s1=8869835, s2=9976536, s3=9422900, s4=10582759, s5=10582017, s6=10584517] (stddev=662170.98, mean=10003094.00, sum=60018564)
5555
artifacts[mma-and-count]: 7f610ee196e8be23
5656
==========================
57+
Cluster Set Up
58+
n1(AU_EAST,AU_EAST_1,0vcpu): {s1:(256GiB)}
59+
n2(AU_EAST,AU_EAST_1,0vcpu): {s2:(256GiB)}
60+
n3(AU_EAST,AU_EAST_1,0vcpu): {s3:(256GiB)}
61+
n4(AU_EAST,AU_EAST_1,0vcpu): {s4:(256GiB)}
62+
n5(AU_EAST,AU_EAST_1,0vcpu): {s5:(256GiB)}
63+
n6(AU_EAST,AU_EAST_1,0vcpu): {s6:(256GiB)}
64+
Key Space
65+
[1,10000): 36(rf=3), 256MiB, [{s1*,s2,s3}:36]
66+
[10001,20000): 36(rf=3), 256MiB, [{s4*,s5,s6}:36]
67+
Event
68+
set LBRebalancingMode to 4
69+
Workload Set Up
70+
[1,10000): read-only high-cpu [500.00cpu-us/op, 1B/op, 1000ops/s]
71+
[10001,20000): write-only large-block [0.00cpu-us/write(raft), 1000B/op, 20000ops/s]
72+
Changed Settings
73+
ReplicateQueueEnabled: false (default: true)
74+
LeaseQueueEnabled: false (default: true)
75+
SplitQueueEnabled: false (default: true)
76+
==========================

0 commit comments

Comments
 (0)