Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions service_capacity_modeling/models/org/netflix/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def extra_model_arguments_schema() -> Dict[str, Any]:
def compose_with(
user_desires: CapacityDesires, extra_model_arguments: Dict[str, Any]
) -> Tuple[Tuple[str, Callable[[CapacityDesires], CapacityDesires]], ...]:
def _modify_crdb_desires(
def _modify_postgres_desires(
user_desires: CapacityDesires,
) -> CapacityDesires:
relaxed = user_desires.model_copy(deep=True)
Expand Down Expand Up @@ -96,7 +96,7 @@ def _modify_elasticsearch_desires(
return relaxed

return (
("org.netflix.cockroachdb", _modify_crdb_desires),
("org.netflix.postgres", _modify_postgres_desires),
("org.netflix.key-value", lambda x: x),
("org.netflix.elasticsearch", _modify_elasticsearch_desires),
)
Expand Down
14 changes: 2 additions & 12 deletions tests/netflix/test_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def test_entity_increasing_qps_simple():
+ list(cap_plan.least_regret[0].candidate_clusters.zonal)
}
assert sorted(types) == [
"aurora-cluster",
"cassandra",
"cockroachdb",
"dgwentity",
"dgwkv",
"elasticsearch-data",
Expand All @@ -64,11 +64,6 @@ def test_entity_increasing_qps_simple():
assert entity_plan.instance.family[0] in ("m", "r")
# We should never be paying for ephemeral drives
assert entity_plan.instance.drive is None
# CRDB disk usage should be num items * 512 bytes/per item ~= 6 GB (rounded up)

for c in cap_plan.least_regret[0].requirements.zonal:
if c.requirement_type == "crdb-zonal":
assert c.disk_gib.mid == 6.0

# Should have more capacity as requirement increases
x = [r[0] for r in entity_results_trend]
Expand Down Expand Up @@ -114,8 +109,8 @@ def test_entity_increasing_qps_item_count_unset():
+ list(cap_plan.least_regret[0].candidate_clusters.zonal)
}
assert sorted(types) == [
"aurora-cluster",
"cassandra",
"cockroachdb",
"dgwentity",
"dgwkv",
"elasticsearch-data",
Expand All @@ -135,11 +130,6 @@ def test_entity_increasing_qps_item_count_unset():
assert entity_plan.instance.family[0] in ("m", "r")
# We should never be paying for ephemeral drives
assert entity_plan.instance.drive is None
# CRDB disk usage should be num items * 512 bytes/per item ~= 7 GB (rounded up)

for c in cap_plan.least_regret[0].requirements.zonal:
if c.requirement_type == "crdb-zonal":
assert c.disk_gib.mid == 7.0

# Should have more capacity as requirement increases
x = [r[0] for r in entity_results_trend]
Expand Down