Skip to content

Commit

Permalink
Merge pull request #58 from Netflix-Skunkworks/feature/shengweiw/crdb…
Browse files Browse the repository at this point in the history
…_license

Using service shape to get crdb license fee
  • Loading branch information
ShengweiWang committed Jun 20, 2023
2 parents adce7af + dd6d198 commit 5337617
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions service_capacity_modeling/hardware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def price_hardware(hardware: Hardware, pricing: Pricing) -> GlobalHardware:
priced_services[
svc
].annual_cost_per_write_io = svc_price.annual_cost_per_write_io
priced_services[
svc
].annual_cost_per_core = svc_price.annual_cost_per_core

regions[region] = Hardware(
instances=priced_instances,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
},
"net.intra.region": {
"annual_cost_per_gib": 0.02
},
"crdb_core_license": {
"annual_cost_per_core": 0
}
},
"zones_in_region": 3
Expand Down
3 changes: 3 additions & 0 deletions service_capacity_modeling/hardware/profiles/shapes/aws.json
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,9 @@
},
"net.intra.region": {
"name": "Intra-region (within) transfer costs"
},
"crdb_core_license": {
"name": "CRDB license fee"
}
}
}
2 changes: 2 additions & 0 deletions service_capacity_modeling/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ class Service(ExcludeUnsetModel):
annual_cost_per_gib: float = 0
annual_cost_per_read_io: float = 0
annual_cost_per_write_io: float = 0
annual_cost_per_core: float = 0

# These defaults assume a cloud blob storage like S3
read_io_latency_ms: FixedInterval = FixedInterval(
Expand Down Expand Up @@ -377,6 +378,7 @@ class ServicePricing(ExcludeUnsetModel):
annual_cost_per_gib: float = 0
annual_cost_per_read_io: float = 0
annual_cost_per_write_io: float = 0
annual_cost_per_core: float = 0


class HardwarePricing(ExcludeUnsetModel):
Expand Down
2 changes: 1 addition & 1 deletion service_capacity_modeling/models/org/netflix/crdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def capacity_plan(
max_local_disk_gib: int = extra_model_arguments.get("max_local_disk_gib", 2048)
# Cockroach Labs recommends a minimum of 8 vCPUs and strongly recommends no fewer than 4 vCPUs per node.
min_vcpu_per_instance: int = extra_model_arguments.get("min_vcpu_per_instance", 4)
license_fee_per_core: float = extra_model_arguments.get("license_fee_per_core", 0.0)
license_fee_per_core: float = context.services["crdb_core_license"].annual_cost_per_core

return _estimate_cockroachdb_cluster_zonal(
instance=instance,
Expand Down

0 comments on commit 5337617

Please sign in to comment.