service-capacity-modeling 0.3.47__tar.gz → 0.3.48__tar.gz
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-0.3.47 → service_capacity_modeling-0.3.48}/PKG-INFO +1 -1
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/kafka.py +41 -16
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling.egg-info/PKG-INFO +1 -1
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/LICENSE +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/README.md +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/__init__.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/capacity_planner.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/__init__.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/__init__.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/pricing/aws/3yr-reserved_ec2.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/pricing/aws/3yr-reserved_zz-overrides.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/profiles.txt +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_c5.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_c5a.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_c5d.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_c5n.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_c6a.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_c6i.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_c6id.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_c7a.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_c7i.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_m4.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_m5.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_m5n.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_m6a.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_m6i.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_m6id.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_m6idn.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_m6in.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_m7a.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_m7i.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_r4.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_r5.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_r5n.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_r6a.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_r6i.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_r6id.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_r6idn.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_r6in.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_r7a.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/auto_r7i.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/manual_drives.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/manual_instances.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/hardware/profiles/shapes/aws/manual_services.json +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/interface.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/__init__.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/common.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/headroom_strategy.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/__init__.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/__init__.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/aurora.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/cassandra.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/counter.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/crdb.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/ddb.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/elasticsearch.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/entity.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/evcache.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/graphkv.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/iso_date_math.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/key_value.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/postgres.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/rds.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/stateless_java.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/time_series.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/time_series_config.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/wal.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/org/netflix/zookeeper.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/models/utils.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/stats.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/tools/__init__.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/tools/auto_shape.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/tools/fetch_pricing.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/tools/generate_missing.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling/tools/instance_families.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling.egg-info/SOURCES.txt +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling.egg-info/dependency_links.txt +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling.egg-info/entry_points.txt +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling.egg-info/requires.txt +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/service_capacity_modeling.egg-info/top_level.txt +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/setup.cfg +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/setup.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_arguments.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_buffers.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_common.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_desire_merge.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_generate_scenarios.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_hardware.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_hardware_shapes.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_headroom_strategy.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_io2.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_model_dump.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_reproducible.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_simulation.py +0 -0
- {service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_working_set.py +0 -0
|
@@ -18,6 +18,7 @@ from service_capacity_modeling.interface import certain_float
|
|
|
18
18
|
from service_capacity_modeling.interface import certain_int
|
|
19
19
|
from service_capacity_modeling.interface import Clusters
|
|
20
20
|
from service_capacity_modeling.interface import Consistency
|
|
21
|
+
from service_capacity_modeling.interface import CurrentZoneClusterCapacity
|
|
21
22
|
from service_capacity_modeling.interface import DataShape
|
|
22
23
|
from service_capacity_modeling.interface import Drive
|
|
23
24
|
from service_capacity_modeling.interface import GIB_IN_BYTES
|
|
@@ -47,13 +48,30 @@ def target_cpu_utilization(tier: int) -> float:
|
|
|
47
48
|
"""
|
|
48
49
|
Returns the target average cluster CPU utilization for a given tier
|
|
49
50
|
"""
|
|
50
|
-
if tier
|
|
51
|
-
return 0.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
if tier in (0, 1):
|
|
52
|
+
return 0.40
|
|
53
|
+
return 0.50
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _get_current_zonal_cluster(
|
|
57
|
+
desires: CapacityDesires,
|
|
58
|
+
) -> Optional[CurrentZoneClusterCapacity]:
|
|
59
|
+
return (
|
|
60
|
+
None
|
|
61
|
+
if desires.current_clusters is None
|
|
62
|
+
else (
|
|
63
|
+
desires.current_clusters.zonal[0]
|
|
64
|
+
if len(desires.current_clusters.zonal)
|
|
65
|
+
else None
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _is_same_instance_family(cluster, target_family):
|
|
71
|
+
"""Check if cluster has a different instance family than the target."""
|
|
72
|
+
if not cluster or not cluster.cluster_instance:
|
|
73
|
+
return False
|
|
74
|
+
return cluster.cluster_instance.family == target_family
|
|
57
75
|
|
|
58
76
|
|
|
59
77
|
def _estimate_kafka_requirement( # pylint: disable=too-many-positional-arguments
|
|
@@ -90,15 +108,7 @@ def _estimate_kafka_requirement( # pylint: disable=too-many-positional-argument
|
|
|
90
108
|
write_mib_per_second
|
|
91
109
|
)
|
|
92
110
|
# use the current cluster capacity if available
|
|
93
|
-
current_zonal_cluster = (
|
|
94
|
-
None
|
|
95
|
-
if desires.current_clusters is None
|
|
96
|
-
else (
|
|
97
|
-
desires.current_clusters.zonal[0]
|
|
98
|
-
if len(desires.current_clusters.zonal)
|
|
99
|
-
else None
|
|
100
|
-
)
|
|
101
|
-
)
|
|
111
|
+
current_zonal_cluster = _get_current_zonal_cluster(desires)
|
|
102
112
|
|
|
103
113
|
if (
|
|
104
114
|
current_zonal_cluster
|
|
@@ -230,6 +240,7 @@ def _estimate_kafka_cluster_zonal( # pylint: disable=too-many-positional-argume
|
|
|
230
240
|
max_local_disk_gib: int = 1024 * 5,
|
|
231
241
|
min_instance_cpu: int = 2,
|
|
232
242
|
min_instance_memory_gib: int = 12,
|
|
243
|
+
require_same_instance_family: bool = True,
|
|
233
244
|
) -> Optional[CapacityPlan]:
|
|
234
245
|
|
|
235
246
|
# Kafka doesn't like to deploy on single CPU instances or with < 12 GiB of ram
|
|
@@ -248,6 +259,15 @@ def _estimate_kafka_cluster_zonal( # pylint: disable=too-many-positional-argume
|
|
|
248
259
|
if instance.drive is None and drive.name != "gp3":
|
|
249
260
|
return None
|
|
250
261
|
|
|
262
|
+
# If there is a current cluster, check if we are restricted to same instance family
|
|
263
|
+
current_zonal_cluster = _get_current_zonal_cluster(desires)
|
|
264
|
+
if (
|
|
265
|
+
current_zonal_cluster
|
|
266
|
+
and require_same_instance_family
|
|
267
|
+
and not _is_same_instance_family(current_zonal_cluster, instance.family)
|
|
268
|
+
):
|
|
269
|
+
return None
|
|
270
|
+
|
|
251
271
|
requirement, regrets = _estimate_kafka_requirement(
|
|
252
272
|
instance=instance,
|
|
253
273
|
desires=desires,
|
|
@@ -461,6 +481,10 @@ class NflxKafkaCapacityModel(CapacityModel):
|
|
|
461
481
|
required_zone_size: Optional[int] = extra_model_arguments.get(
|
|
462
482
|
"required_zone_size", None
|
|
463
483
|
)
|
|
484
|
+
# By default, for existing clusters, restrict to only using same instance family
|
|
485
|
+
require_same_instance_family: bool = extra_model_arguments.get(
|
|
486
|
+
"require_same_instance_family", True
|
|
487
|
+
)
|
|
464
488
|
|
|
465
489
|
return _estimate_kafka_cluster_zonal(
|
|
466
490
|
instance=instance,
|
|
@@ -476,6 +500,7 @@ class NflxKafkaCapacityModel(CapacityModel):
|
|
|
476
500
|
min_instance_cpu=min_instance_cpu,
|
|
477
501
|
min_instance_memory_gib=min_instance_memory_gib,
|
|
478
502
|
hot_retention_seconds=hot_retention_seconds,
|
|
503
|
+
require_same_instance_family=require_same_instance_family,
|
|
479
504
|
)
|
|
480
505
|
|
|
481
506
|
@staticmethod
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_arguments.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_desire_merge.py
RENAMED
|
File without changes
|
|
File without changes
|
{service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_hardware.py
RENAMED
|
File without changes
|
{service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_hardware_shapes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_model_dump.py
RENAMED
|
File without changes
|
{service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_reproducible.py
RENAMED
|
File without changes
|
{service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_simulation.py
RENAMED
|
File without changes
|
{service_capacity_modeling-0.3.47 → service_capacity_modeling-0.3.48}/tests/test_working_set.py
RENAMED
|
File without changes
|