From 2fb0c498c96513293e1ebb3241c5de8441870714 Mon Sep 17 00:00:00 2001 From: Akashdeep Goel Date: Tue, 10 Oct 2023 20:41:14 -0700 Subject: [PATCH] Fix item count bug --- service_capacity_modeling/models/org/netflix/evcache.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/service_capacity_modeling/models/org/netflix/evcache.py b/service_capacity_modeling/models/org/netflix/evcache.py index 8d819db..8e08590 100644 --- a/service_capacity_modeling/models/org/netflix/evcache.py +++ b/service_capacity_modeling/models/org/netflix/evcache.py @@ -101,7 +101,11 @@ def _estimate_evcache_requirement( item_count = desires.data_shape.estimated_state_item_count payload_greater_than_classic = False if state_size is not None and item_count is not None: - payload_size = (state_size.mid * 1024.0 * 1024.0 * 1024.0) / (item_count.mid) + if item_count.mid != 0: + payload_size = (state_size.mid * 1024.0 * 1024.0 * 1024.0) / (item_count.mid) + else: + payload_size = 0.0 + if payload_size > 200.0: payload_greater_than_classic = True