Skip to content

Commit 169b7ab

Browse files
committed
asim: port over some trivial commits from prototype
This commit ports over some trivial changes from the mma prototype branch. Epic: CRDB-25222 Release note: none
1 parent 5c2f5e3 commit 169b7ab

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

pkg/kv/kvserver/asim/metrics/series.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func MakeTS(metrics [][]StoreMetrics) map[string][][]float64 {
1717
}
1818

1919
stores := len(metrics[0])
20-
// TODO(kvoli): Either begin resuing prometheus metric definitions with a
20+
// TODO(kvoli): Either begin reusing prometheus metric definitions with a
2121
// custom scraper or provide definitions for each metric available. These
2222
// are partially duplicated with the cluster tracker.
2323
ret["qps"] = make([][]float64, stores)

pkg/kv/kvserver/asim/state/load.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ func LoadEventQPS(le workload.LoadEvent) float64 {
3939

4040
// ReplicaLoadCounter is the sum of all key accesses and size of bytes, both written
4141
// and read.
42-
// TODO(kvoli): In the non-simulated code, replica_stats currently maintains
43-
// this structure, which is rated. This datastructure needs to be adapated by
44-
// the user to be rated over time. In the future we should introduce a better
45-
// general pupose stucture that enables rating.
4642
type ReplicaLoadCounter struct {
4743
WriteKeys int64
4844
WriteBytes int64

pkg/kv/kvserver/asim/state/parser_replica_placement.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ func ParseReplicaPlacement(input string) ReplicaPlacement {
121121
}
122122
// For matches[0] and stores[0], storeID will be 1.
123123
storeID, _ := strconv.Atoi(parts[0][1:])
124+
if storeID == 0 {
125+
panic(fmt.Sprintf("unable to parse store id: %s", parts[0][1:]))
126+
}
124127
storeSet = append(storeSet, storeID)
125128

126129
// If the replica type or leaseholder is not specified, artificially

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,16 @@ var runAsimTests = envutil.EnvOrDefaultBool("COCKROACH_RUN_ASIM_TESTS", false)
145145
// constraints(violating) at the end of the evaluation.
146146
//
147147
// - "setting" [replicate_queue_enabled=bool] [lease_queue_enabled=bool]
148-
// [split_queue_enabled=bool] [rebalance_mode=<int>] [rebalance_interval=<duration>]
149-
// [rebalance_qps_threshold=<float>] [split_qps_threshold=<float>]
148+
// [split_queue_enabled=bool] [rebalance_interval=<duration>]
149+
// [rebalance_mode=<int>] [split_qps_threshold=<float>]
150150
// [rebalance_range_threshold=<float>] [gossip_delay=<duration>]
151+
// [rebalance_objective=<int>]
151152
// Configure the simulation's various settings. The default values are:
152-
// rebalance_mode=2 (leases and replicas) rebalance_interval=1m (1 minute)
153-
// rebalance_qps_threshold=0.1 split_qps_threshold=2500
154-
// rebalance_range_threshold=0.05 gossip_delay=500ms.
153+
// replicate_queue_enabled=true lease_queue_enabled=true
154+
// split_queue_enabled=true rebalance_interval=1m (1 minute)
155+
// rebalance_mode=2 (leases and replicas) split_qps_threshold=2500
156+
// rebalance_range_threshold=0.05 gossip_delay=500ms rebalance_objective=0
157+
// (QPS) (1=CPU)
155158
//
156159
// - "eval" [duration=<string>] [samples=<int>] [seed=<int>]
157160
// Run samples (e.g. samples=5) number of simulations for duration (e.g.

0 commit comments

Comments
 (0)