service-capacity-modeling 0.3.97__py3-none-any.whl → 0.3.99__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.
@@ -1064,12 +1064,36 @@ class CapacityDesires(ExcludeUnsetModel):
1064
1064
  .get("estimated_state_size_gib", None)
1065
1065
  )
1066
1066
  user_count = self.data_shape.estimated_state_item_count
1067
- item_size_bytes = desires.query_pattern.estimated_mean_write_size_bytes.mid
1067
+
1068
+ # Bidirectional inference: state_size_gib ↔ item_count
1069
+ #
1070
+ # Users often know one but not the other. We can infer the missing value:
1071
+ # state_size_gib = item_count × item_size_bytes
1072
+ # item_count = state_size_gib / item_size_bytes
1073
+ #
1074
+ # Item size comes from write_size (the size of records written to storage).
1075
+ # For read-only workloads (e.g., read replicas), use read_size as fallback.
1076
+ # If user provided both or neither, no inference is needed.
1077
+ item_size_bytes = (
1078
+ desires.query_pattern.estimated_mean_write_size_bytes.mid
1079
+ or desires.query_pattern.estimated_mean_read_size_bytes.mid
1080
+ )
1081
+
1068
1082
  if user_size is None and user_count is not None:
1083
+ if not item_size_bytes:
1084
+ raise ValueError(
1085
+ "Model default_desires() must set estimated_mean_write_size_bytes "
1086
+ "or estimated_mean_read_size_bytes to infer state_size_gib"
1087
+ )
1069
1088
  desires.data_shape.estimated_state_size_gib = user_count.scale(
1070
1089
  factor=(item_size_bytes / GIB_IN_BYTES)
1071
1090
  )
1072
1091
  elif user_size is not None and user_count is None:
1092
+ if not item_size_bytes:
1093
+ raise ValueError(
1094
+ "Model default_desires() must set estimated_mean_write_size_bytes "
1095
+ "or estimated_mean_read_size_bytes to infer item_count"
1096
+ )
1073
1097
  user_size_gib = self.data_shape.estimated_state_size_gib
1074
1098
  desires.data_shape.estimated_state_item_count = user_size_gib.scale(
1075
1099
  factor=(GIB_IN_BYTES / item_size_bytes)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: service-capacity-modeling
3
- Version: 0.3.97
3
+ Version: 0.3.99
4
4
  Summary: Contains utilities for modeling capacity for pluggable workloads
5
5
  Author: Joseph Lynch
6
6
  Author-email: josephl@netflix.com
@@ -1,7 +1,7 @@
1
1
  service_capacity_modeling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  service_capacity_modeling/capacity_planner.py,sha256=JRagEFlg3u_zB1N5GzGsKAN55JZLad6p4IF_PmL8kcg,32780
3
3
  service_capacity_modeling/enum_utils.py,sha256=50Rw2kgYoJYCrybSbo9WaPPCWxlF5CyPCQtHxQ3kB18,5229
4
- service_capacity_modeling/interface.py,sha256=mgX2qUsYf_rVxbYg1rFjRUH-QY11Z87mke4nWa1LwhM,42327
4
+ service_capacity_modeling/interface.py,sha256=jTuMoMc6XEbMl859YNAwV9RiEgJf4phe6g1qHp7_kNg,43453
5
5
  service_capacity_modeling/stats.py,sha256=LCNUcQPfwF5hhIZwsfAsDe4ZbnuhDnl3vQHKfpK61Xc,6142
6
6
  service_capacity_modeling/hardware/__init__.py,sha256=P5ostvoSOMUqPODtepeFYb4qfTVH0E73mMFraP49rYU,9196
7
7
  service_capacity_modeling/hardware/profiles/__init__.py,sha256=7-y3JbCBkgzaAjFla2RIymREcImdZ51HTl3yn3vzoGw,1602
@@ -82,9 +82,9 @@ service_capacity_modeling/tools/auto_shape.py,sha256=K248-DayPrcZwLw1dYr47lpeQQw
82
82
  service_capacity_modeling/tools/fetch_pricing.py,sha256=fO84h77cqiiIHF4hZt490RwbZ6JqjB45UsnPpV2AXD4,6122
83
83
  service_capacity_modeling/tools/generate_missing.py,sha256=F7YqvMJAV4nZc20GNrlIsnQSF8_77sLgwYZqc5k4LDg,3099
84
84
  service_capacity_modeling/tools/instance_families.py,sha256=e5RuYkCLUITvsAazDH12B6KjX_PaBsv6Ne3mj0HK_sQ,9223
85
- service_capacity_modeling-0.3.97.dist-info/licenses/LICENSE,sha256=nl_Lt5v9VvJ-5lWJDT4ddKAG-VZ-2IaLmbzpgYDz2hU,11343
86
- service_capacity_modeling-0.3.97.dist-info/METADATA,sha256=I6GBTdx5luWUAjT5_LSU0Mo3Py4YWflJIeuu7_PbSjI,10366
87
- service_capacity_modeling-0.3.97.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
88
- service_capacity_modeling-0.3.97.dist-info/entry_points.txt,sha256=ZsjzpG5SomWpT1zCE19n1uSXKH2gTI_yc33sdl0vmJg,146
89
- service_capacity_modeling-0.3.97.dist-info/top_level.txt,sha256=H8XjTCLgR3enHq5t3bIbxt9SeUkUT8HT_SDv2dgIT_A,26
90
- service_capacity_modeling-0.3.97.dist-info/RECORD,,
85
+ service_capacity_modeling-0.3.99.dist-info/licenses/LICENSE,sha256=nl_Lt5v9VvJ-5lWJDT4ddKAG-VZ-2IaLmbzpgYDz2hU,11343
86
+ service_capacity_modeling-0.3.99.dist-info/METADATA,sha256=qxKT3t31WfU-qh6QPhnR3Fdnwz_EkjkZhJLp-VmqHY4,10366
87
+ service_capacity_modeling-0.3.99.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
88
+ service_capacity_modeling-0.3.99.dist-info/entry_points.txt,sha256=ZsjzpG5SomWpT1zCE19n1uSXKH2gTI_yc33sdl0vmJg,146
89
+ service_capacity_modeling-0.3.99.dist-info/top_level.txt,sha256=H8XjTCLgR3enHq5t3bIbxt9SeUkUT8HT_SDv2dgIT_A,26
90
+ service_capacity_modeling-0.3.99.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5