Skip to content

Commit

Permalink
test to validate merge of derived buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushis committed Mar 4, 2025
1 parent 36a98e2 commit 0df03b6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_desire_merge.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from service_capacity_modeling.capacity_planner import planner
from service_capacity_modeling.interface import Buffer
from service_capacity_modeling.interface import BufferComponent
from service_capacity_modeling.interface import BufferIntent
from service_capacity_modeling.interface import Buffers
from service_capacity_modeling.interface import CapacityDesires
from service_capacity_modeling.interface import certain_int
Expand All @@ -25,7 +26,12 @@
desired={
"custom": Buffer(ratio=3.8, components=["custom"]),
"custom-cpu": Buffer(ratio=3.0, components=[BufferComponent.cpu]),
}
},
derived={
"compute": Buffer(
intent=BufferIntent.scale, ratio=2, components=["compute"]
)
},
),
)

Expand All @@ -41,6 +47,9 @@ def test_cassandra_merge():
assert merged.query_pattern.estimated_read_per_second.mid == 100000
assert merged.query_pattern.estimated_mean_read_size_bytes.low == 10
assert merged.data_shape.estimated_state_size_gib.mid == 10
assert merged.buffers.derived.get("compute") is not None
assert merged.buffers.derived["compute"].ratio == 2.0
assert merged.buffers.derived["compute"].intent == BufferIntent.scale

# Should come from cassandra model
assert merged.query_pattern.estimated_mean_read_latency_ms.mid == 2.0
Expand Down

0 comments on commit 0df03b6

Please sign in to comment.