Skip to content

Conversation

@angeladietz
Copy link
Contributor

Previously, the datadriven asim tests expressed node capacity in nanoseconds/core which are difficult to read due to lots of zeros. Now, the node capacity is expressed in cores (float) which is much more readable and less prone to user error. For example, node_cpu_rate_capacity=8000000000 is now expressed as node_cpu_cores=8.

Fixes #156845
Epic: CRDB-55052
Release note: none.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@angeladietz angeladietz force-pushed the node-capacity-units branch 3 times, most recently from 8972085 to b418f28 Compare November 20, 2025 20:41
@angeladietz angeladietz marked this pull request as ready for review November 20, 2025 21:07
@angeladietz angeladietz requested review from a team as code owners November 20, 2025 21:07
@angeladietz
Copy link
Contributor Author

For now, i only updated the the node capacity in the input format, but not in the underlying data structures, like BasicCluster.NodeCPURateCapacity and ClusterInfo.NodeCPURateCapacityNanos. Should the CPU units be updated there too, or is it only the input format we're worried about?

Copy link
Contributor

@wenyihu6 wenyihu6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think only the input, so this should be enough.
:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained


pkg/kv/kvserver/asim/state/node_cpu_cores_test.go line 14 at r1 (raw file):

)

func TestNodeCPUCores_ToRateCapacityNanos(t *testing.T) {

Nice test!

Copy link
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@tbg reviewed 15 of 15 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @angeladietz)


pkg/kv/kvserver/asim/config/settings.go line 36 at r1 (raw file):

const (
	DefaultNodeCPUCores                   = 8.0        // 8 vcpus
	DefaultNodeCPURateCapacityNanos       = 8 * 1e9    // 8 vcpus

nit: make this DefaultNodeCPUCores * 1e9.

Previously, the datadriven asim tests expressed node capacity in
nanoseconds/core which are difficult to read due to lots of zeros.
Now, the node capacity is expressed in cores (float) which is much more
readable and less prone to user error. For example,
`node_cpu_rate_capacity=8000000000` is now expressed as `node_cpu_cores=8`.

Fixes cockroachdb#156845
Epic: CRDB-55052
Release note: none.
@angeladietz
Copy link
Contributor Author

TFTRs! bors r+

@tbg
Copy link
Member

tbg commented Nov 21, 2025

bors r+
☝🏽
needs to be on its own line

@craig craig bot merged commit ab5107e into cockroachdb:master Nov 21, 2025
22 of 24 checks passed
@craig
Copy link
Contributor

craig bot commented Nov 21, 2025

@angeladietz
Copy link
Contributor Author

needs to be on its own line

ah good to know, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

asim: specify node capacity in cores, not nanos/sec

4 participants