Skip to content

Commit fc035ee

Browse files
committed
assertion: fix thresholds to allow endpoints
This is actually what they implement. For example, some testdata assertions we have (and which pass) today verify that a metric does not change at all by providing an upper_bound of zero for a `steady` assertion, which can only pass if the metric is constant (equal to the mean).
1 parent 3126dc0 commit fc035ee

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

pkg/kv/kvserver/asim/assertion/assert.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ func (tht ThresholdType) String() string {
3434
case ExactBound:
3535
return "="
3636
case UpperBound:
37-
return "<"
37+
return ""
3838
case LowerBound:
39-
return ">"
39+
return ""
4040
default:
4141
panic("unknown threshold type")
4242
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ add_node
1919
# Assert that the replica counts balance within 5% of each other among stores.
2020
assertion type=balance stat=replicas ticks=6 upper_bound=1.05
2121
----
22-
asserting: max_{stores}(replicas)/mean_{stores}(replicas) < 1.05 at each of last 6 ticks
22+
asserting: max_{stores}(replicas)/mean_{stores}(replicas) 1.05 at each of last 6 ticks
2323

2424
# Update the replication factor for the keyspace to be 3, instead of the
2525
# initial replication factor of 1 set during generation.
@@ -36,7 +36,7 @@ replicas#1: first: [s1=301, s2=0, s3=0] (stddev=141.89, mean=100.33, sum=301)
3636
replicas#1: last: [s1=301, s2=271, s3=267] (stddev=15.17, mean=279.67, sum=839)
3737
artifacts[sma-count]: 866426beb5ad043b
3838
failed assertion sample 1
39-
balance stat=replicas threshold=(<1.05) ticks=6
39+
balance stat=replicas threshold=(1.05) ticks=6
4040
max/mean=1.08 tick=0
4141
max/mean=1.08 tick=1
4242
max/mean=1.08 tick=2

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ gen_load rate=7000 min_block=512 max_block=512
1313

1414
assertion stat=leases type=balance ticks=6 upper_bound=1
1515
----
16-
asserting: max_{stores}(leases)/mean_{stores}(leases) < 1.00 at each of last 6 ticks
16+
asserting: max_{stores}(leases)/mean_{stores}(leases) 1.00 at each of last 6 ticks
1717

1818
assertion stat=leases type=steady ticks=6 upper_bound=0
1919
----
20-
asserting: |leases(t)/mean_{T}(leases) - 1| < 0.00 ∀ t∈T and each store (T=last 6 ticks)
20+
asserting: |leases(t)/mean_{T}(leases) - 1| 0.00 ∀ t∈T and each store (T=last 6 ticks)
2121

2222
eval duration=5m seed=42 metrics=(leases) cfgs=(sma-count,mma-only)
2323
----
@@ -28,7 +28,7 @@ leases#1: first: [s1=8, s2=3, s3=0, s4=0, s5=0, s6=0, s7=0, s8=0, s9=1, s10=0, s
2828
leases#1: last: [s1=4, s2=1, s3=0, s4=0, s5=0, s6=1, s7=0, s8=0, s9=1, s10=1, s11=1, s12=1, s13=2, s14=2] (stddev=1.07, mean=1.00, sum=14)
2929
artifacts[mma-only]: 3c31149bdddfe022
3030
failed assertion sample 1
31-
balance stat=leases threshold=(<1.00) ticks=6
31+
balance stat=leases threshold=(1.00) ticks=6
3232
max/mean=4.00 tick=0
3333
max/mean=4.00 tick=1
3434
max/mean=4.00 tick=2

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ gen_load rate=7000 rw_ratio=0.95 access_skew=false min_block=128 max_block=256
2121
# seconds) the max/mean QPS of the cluster does not exceed 1.15.
2222
assertion stat=qps type=balance ticks=6 upper_bound=1.15
2323
----
24-
asserting: max_{stores}(qps)/mean_{stores}(qps) < 1.15 at each of last 6 ticks
24+
asserting: max_{stores}(qps)/mean_{stores}(qps) 1.15 at each of last 6 ticks
2525

2626
# The second is a steady state assertion. The steady state assertion requires
2727
# that during the last 6 ticks (60 seconds), the value of QPS per-store doesn't
@@ -32,7 +32,7 @@ asserting: max_{stores}(qps)/mean_{stores}(qps) < 1.15 at each of last 6 ticks
3232
# to take a duration, not ticks.
3333
assertion stat=qps type=steady ticks=6 upper_bound=0.05
3434
----
35-
asserting: |qps(t)/mean_{T}(qps) - 1| < 0.05 ∀ t∈T and each store (T=last 6 ticks)
35+
asserting: |qps(t)/mean_{T}(qps) - 1| 0.05 ∀ t∈T and each store (T=last 6 ticks)
3636

3737
# The generators are then called and 2 simulation runs, named samples are
3838
# created and evaluated. Each sample has a fixed duration of 3 minutes.
@@ -50,15 +50,15 @@ qps#1: last: [s1=3999, s2=1997, s3=0, s4=0, s5=0, s6=1003, s7=0] (stddev=1413.6
5050
qps#2: last: [s1=3996, s2=1996, s3=0, s4=0, s5=0, s6=1006, s7=0] (stddev=1412.60, mean=999.71, sum=6998)
5151
artifacts[mma-only]: c48e80aec15208d6
5252
failed assertion sample 1
53-
balance stat=qps threshold=(<1.15) ticks=6
53+
balance stat=qps threshold=(1.15) ticks=6
5454
max/mean=4.00 tick=0
5555
max/mean=4.00 tick=1
5656
max/mean=4.00 tick=2
5757
max/mean=4.00 tick=3
5858
max/mean=4.00 tick=4
5959
max/mean=4.00 tick=5
6060
failed assertion sample 2
61-
balance stat=qps threshold=(<1.15) ticks=6
61+
balance stat=qps threshold=(1.15) ticks=6
6262
max/mean=4.00 tick=0
6363
max/mean=4.00 tick=1
6464
max/mean=4.00 tick=2
@@ -90,15 +90,15 @@ qps#1: last: [s1=3995, s2=1998, s3=0, s4=0, s5=0, s6=1005, s7=0] (stddev=1412.5
9090
qps#2: last: [s1=4000, s2=1995, s3=0, s4=0, s5=0, s6=1004, s7=0] (stddev=1413.71, mean=999.86, sum=6999)
9191
artifacts[mma-only]: fc6f065395b9a390
9292
failed assertion sample 1
93-
balance stat=qps threshold=(<1.15) ticks=6
93+
balance stat=qps threshold=(1.15) ticks=6
9494
max/mean=4.00 tick=0
9595
max/mean=4.00 tick=1
9696
max/mean=4.00 tick=2
9797
max/mean=4.00 tick=3
9898
max/mean=4.00 tick=4
9999
max/mean=4.00 tick=5
100100
failed assertion sample 2
101-
balance stat=qps threshold=(<1.15) ticks=6
101+
balance stat=qps threshold=(1.15) ticks=6
102102
max/mean=4.00 tick=0
103103
max/mean=4.00 tick=1
104104
max/mean=4.00 tick=2

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ setting split_qps_threshold=2500
2222
# ticks of the simulation.
2323
assertion stat=replicas type=steady ticks=6 upper_bound=0.00
2424
----
25-
asserting: |replicas(t)/mean_{T}(replicas) - 1| < 0.00 ∀ t∈T and each store (T=last 6 ticks)
25+
asserting: |replicas(t)/mean_{T}(replicas) - 1| 0.00 ∀ t∈T and each store (T=last 6 ticks)
2626

2727

2828
# Examine the number of replicas. Here there were 5 load based splits. This

0 commit comments

Comments
 (0)