service-capacity-modeling 0.3.89__py3-none-any.whl → 0.3.91__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- service_capacity_modeling/models/org/netflix/cassandra.py +50 -38
- {service_capacity_modeling-0.3.89.dist-info → service_capacity_modeling-0.3.91.dist-info}/METADATA +1 -1
- {service_capacity_modeling-0.3.89.dist-info → service_capacity_modeling-0.3.91.dist-info}/RECORD +7 -7
- {service_capacity_modeling-0.3.89.dist-info → service_capacity_modeling-0.3.91.dist-info}/WHEEL +0 -0
- {service_capacity_modeling-0.3.89.dist-info → service_capacity_modeling-0.3.91.dist-info}/entry_points.txt +0 -0
- {service_capacity_modeling-0.3.89.dist-info → service_capacity_modeling-0.3.91.dist-info}/licenses/LICENSE +0 -0
- {service_capacity_modeling-0.3.89.dist-info → service_capacity_modeling-0.3.91.dist-info}/top_level.txt +0 -0
|
@@ -638,8 +638,14 @@ def _target_rf(desires: CapacityDesires, user_copies: Optional[int]) -> int:
|
|
|
638
638
|
|
|
639
639
|
|
|
640
640
|
class NflxCassandraArguments(BaseModel):
|
|
641
|
-
|
|
642
|
-
|
|
641
|
+
"""Configuration arguments for the Netflix Cassandra capacity model.
|
|
642
|
+
|
|
643
|
+
This model centralizes all tunable parameters with their defaults.
|
|
644
|
+
Use `from_extra_model_arguments()` to parse a dict into a validated instance.
|
|
645
|
+
"""
|
|
646
|
+
|
|
647
|
+
copies_per_region: Optional[int] = Field(
|
|
648
|
+
default=None,
|
|
643
649
|
description="How many copies of the data will exist e.g. RF=3. If unsupplied"
|
|
644
650
|
" this will be deduced from durability and consistency desires",
|
|
645
651
|
)
|
|
@@ -663,9 +669,13 @@ class NflxCassandraArguments(BaseModel):
|
|
|
663
669
|
default=192,
|
|
664
670
|
description="What is the maximum size of a cluster in this region",
|
|
665
671
|
)
|
|
666
|
-
|
|
667
|
-
default=
|
|
668
|
-
description="
|
|
672
|
+
max_local_data_per_node_gib: int = Field(
|
|
673
|
+
default=1280,
|
|
674
|
+
description="Maximum data per node for local disk instances (GiB)",
|
|
675
|
+
)
|
|
676
|
+
max_attached_data_per_node_gib: int = Field(
|
|
677
|
+
default=2048,
|
|
678
|
+
description="Maximum data per node for attached disk instances (GiB)",
|
|
669
679
|
)
|
|
670
680
|
max_write_buffer_percent: float = Field(
|
|
671
681
|
default=0.25,
|
|
@@ -680,6 +690,26 @@ class NflxCassandraArguments(BaseModel):
|
|
|
680
690
|
"automatically adjust to 0.2",
|
|
681
691
|
)
|
|
682
692
|
|
|
693
|
+
@classmethod
|
|
694
|
+
def from_extra_model_arguments(
|
|
695
|
+
cls, extra_model_arguments: Dict[str, Any]
|
|
696
|
+
) -> "NflxCassandraArguments":
|
|
697
|
+
"""Parse extra_model_arguments dict into a validated NflxCassandraArguments.
|
|
698
|
+
|
|
699
|
+
This centralizes default values - any field not in extra_model_arguments
|
|
700
|
+
will use the default defined in this model.
|
|
701
|
+
|
|
702
|
+
Handles legacy field name mappings:
|
|
703
|
+
- max_local_disk_gib -> max_local_data_per_node_gib (if not explicitly set)
|
|
704
|
+
"""
|
|
705
|
+
# Handle legacy field name: max_local_disk_gib -> max_local_data_per_node_gib
|
|
706
|
+
args = dict(extra_model_arguments)
|
|
707
|
+
if "max_local_data_per_node_gib" not in args and "max_local_disk_gib" in args:
|
|
708
|
+
args["max_local_data_per_node_gib"] = args["max_local_disk_gib"]
|
|
709
|
+
|
|
710
|
+
# Pydantic will use defaults for any missing fields
|
|
711
|
+
return cls.model_validate(args)
|
|
712
|
+
|
|
683
713
|
|
|
684
714
|
class NflxCassandraCapacityModel(CapacityModel):
|
|
685
715
|
def __init__(self) -> None:
|
|
@@ -722,40 +752,22 @@ class NflxCassandraCapacityModel(CapacityModel):
|
|
|
722
752
|
desires: CapacityDesires,
|
|
723
753
|
extra_model_arguments: Dict[str, Any],
|
|
724
754
|
) -> Optional[CapacityPlan]:
|
|
725
|
-
#
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
#
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
desires, extra_model_arguments.get("copies_per_region", None)
|
|
733
|
-
)
|
|
734
|
-
require_local_disks: bool = extra_model_arguments.get(
|
|
735
|
-
"require_local_disks", False
|
|
736
|
-
)
|
|
737
|
-
require_attached_disks: bool = extra_model_arguments.get(
|
|
738
|
-
"require_attached_disks", False
|
|
739
|
-
)
|
|
755
|
+
# Parse extra_model_arguments into a validated model with centralized defaults
|
|
756
|
+
args = NflxCassandraArguments.from_extra_model_arguments(extra_model_arguments)
|
|
757
|
+
|
|
758
|
+
# Use durability and consistency to compute RF if not explicitly set
|
|
759
|
+
copies_per_region = _target_rf(desires, args.copies_per_region)
|
|
760
|
+
|
|
761
|
+
# Validate required_cluster_size for critical tiers
|
|
740
762
|
required_cluster_size: Optional[int] = (
|
|
741
763
|
NflxCassandraCapacityModel.get_required_cluster_size(
|
|
742
764
|
desires.service_tier, extra_model_arguments
|
|
743
765
|
)
|
|
744
766
|
)
|
|
745
767
|
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
"max_local_data_per_node_gib",
|
|
750
|
-
extra_model_arguments.get("max_local_disk_gib", 1280),
|
|
751
|
-
)
|
|
752
|
-
|
|
753
|
-
max_write_buffer_percent: float = min(
|
|
754
|
-
0.5, extra_model_arguments.get("max_write_buffer_percent", 0.25)
|
|
755
|
-
)
|
|
756
|
-
max_table_buffer_percent: float = min(
|
|
757
|
-
0.5, extra_model_arguments.get("max_table_buffer_percent", 0.11)
|
|
758
|
-
)
|
|
768
|
+
# Apply caps to buffer percentages
|
|
769
|
+
max_write_buffer_percent = min(0.5, args.max_write_buffer_percent)
|
|
770
|
+
max_table_buffer_percent = min(0.5, args.max_table_buffer_percent)
|
|
759
771
|
|
|
760
772
|
# Adjust heap defaults for high write clusters
|
|
761
773
|
if (
|
|
@@ -772,12 +784,12 @@ class NflxCassandraCapacityModel(CapacityModel):
|
|
|
772
784
|
desires=desires,
|
|
773
785
|
zones_per_region=context.zones_in_region,
|
|
774
786
|
copies_per_region=copies_per_region,
|
|
775
|
-
require_local_disks=require_local_disks,
|
|
776
|
-
require_attached_disks=require_attached_disks,
|
|
787
|
+
require_local_disks=args.require_local_disks,
|
|
788
|
+
require_attached_disks=args.require_attached_disks,
|
|
777
789
|
required_cluster_size=required_cluster_size,
|
|
778
|
-
max_rps_to_disk=max_rps_to_disk,
|
|
779
|
-
max_regional_size=max_regional_size,
|
|
780
|
-
max_local_data_per_node_gib=max_local_data_per_node_gib,
|
|
790
|
+
max_rps_to_disk=args.max_rps_to_disk,
|
|
791
|
+
max_regional_size=args.max_regional_size,
|
|
792
|
+
max_local_data_per_node_gib=args.max_local_data_per_node_gib,
|
|
781
793
|
max_write_buffer_percent=max_write_buffer_percent,
|
|
782
794
|
max_table_buffer_percent=max_table_buffer_percent,
|
|
783
795
|
)
|
{service_capacity_modeling-0.3.89.dist-info → service_capacity_modeling-0.3.91.dist-info}/RECORD
RENAMED
|
@@ -53,7 +53,7 @@ service_capacity_modeling/models/utils.py,sha256=WosEEg4o1_WSbTb5mL-M1v8JuWJgvS2
|
|
|
53
53
|
service_capacity_modeling/models/org/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
54
54
|
service_capacity_modeling/models/org/netflix/__init__.py,sha256=2Ld2NPxiO3vbYtOMqHtrV4f1nEH390Hoxqo3I5NbBDI,2553
|
|
55
55
|
service_capacity_modeling/models/org/netflix/aurora.py,sha256=Js33ZjxCtt34HiDPsWRT9mjKCAsnnCo9du15QArVFMo,13073
|
|
56
|
-
service_capacity_modeling/models/org/netflix/cassandra.py,sha256=
|
|
56
|
+
service_capacity_modeling/models/org/netflix/cassandra.py,sha256=MUILIhdxlqIxOwMbFJvy7luRYqBxraIkIVU_ZKnjxOo,39627
|
|
57
57
|
service_capacity_modeling/models/org/netflix/control.py,sha256=wkJnqG7Nn7kQNcKEMzl9LFlA9xTAji2wYxL011VAKPI,5762
|
|
58
58
|
service_capacity_modeling/models/org/netflix/counter.py,sha256=kTDL7dCnkn-XU27_Z1VBc4CCLCPoOqJZe9WgcENHHd4,10517
|
|
59
59
|
service_capacity_modeling/models/org/netflix/crdb.py,sha256=iW7tyG8jpXhHIdXrw3DPYSHRAknPN42MlCRLJO4o9C8,20826
|
|
@@ -77,9 +77,9 @@ service_capacity_modeling/tools/auto_shape.py,sha256=Jx9H2ay9-H_kUDjtB141owQNxGF
|
|
|
77
77
|
service_capacity_modeling/tools/fetch_pricing.py,sha256=Qp-XMymkY1dvtyS51RufmEpfgOHv-IQ-XyzS8wp2-qM,4021
|
|
78
78
|
service_capacity_modeling/tools/generate_missing.py,sha256=F7YqvMJAV4nZc20GNrlIsnQSF8_77sLgwYZqc5k4LDg,3099
|
|
79
79
|
service_capacity_modeling/tools/instance_families.py,sha256=e5RuYkCLUITvsAazDH12B6KjX_PaBsv6Ne3mj0HK_sQ,9223
|
|
80
|
-
service_capacity_modeling-0.3.
|
|
81
|
-
service_capacity_modeling-0.3.
|
|
82
|
-
service_capacity_modeling-0.3.
|
|
83
|
-
service_capacity_modeling-0.3.
|
|
84
|
-
service_capacity_modeling-0.3.
|
|
85
|
-
service_capacity_modeling-0.3.
|
|
80
|
+
service_capacity_modeling-0.3.91.dist-info/licenses/LICENSE,sha256=nl_Lt5v9VvJ-5lWJDT4ddKAG-VZ-2IaLmbzpgYDz2hU,11343
|
|
81
|
+
service_capacity_modeling-0.3.91.dist-info/METADATA,sha256=6xUk3NWMHvKzDLKPcXU-7eyTP8V3Y3UowFfSV8F964s,10366
|
|
82
|
+
service_capacity_modeling-0.3.91.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
83
|
+
service_capacity_modeling-0.3.91.dist-info/entry_points.txt,sha256=ZsjzpG5SomWpT1zCE19n1uSXKH2gTI_yc33sdl0vmJg,146
|
|
84
|
+
service_capacity_modeling-0.3.91.dist-info/top_level.txt,sha256=H8XjTCLgR3enHq5t3bIbxt9SeUkUT8HT_SDv2dgIT_A,26
|
|
85
|
+
service_capacity_modeling-0.3.91.dist-info/RECORD,,
|
{service_capacity_modeling-0.3.89.dist-info → service_capacity_modeling-0.3.91.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|