Skip to content

Add cost methods for EVCache, Kafka, Cassandra with CostAwareModel mixin#206

Merged
homatthew merged 0 commit intoNetflix-Skunkworks:mho/cost-baseline-and-methodsfrom
homatthew:mho/model-cost-methods-reduced
Jan 21, 2026
Merged

Add cost methods for EVCache, Kafka, Cassandra with CostAwareModel mixin#206
homatthew merged 0 commit intoNetflix-Skunkworks:mho/cost-baseline-and-methodsfrom
homatthew:mho/model-cost-methods-reduced

Conversation

@homatthew
Copy link
Contributor

Summary

  • Introduce CostAwareModel mixin for models that implement cost calculation methods
  • Add cluster_costs() and service_costs() to EVCache, Kafka, and Cassandra models
  • Mixin pattern avoids pylint abstract-method warnings while enforcing implementation

Design

Models that compute costs inherit from both CapacityModel and CostAwareModel:

class NflxEVCacheCapacityModel(CapacityModel, CostAwareModel):
    @staticmethod
    def cluster_costs(...) -> Dict[str, float]:
        ...

This mixin can be folded into CapacityModel once all models implement cost methods.

Test plan

  • All 224 Netflix tests pass
  • Cost regression tests pass
  • Pylint passes without warnings

🤖 Generated with Claude Code

@homatthew homatthew changed the base branch from main to mho/cost-baseline-and-methods January 16, 2026 22:43
class CostAwareModel:
"""Mixin for models that implement cost calculation methods.

This is a workaround to avoid pylint abstract-method warnings. Only models
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be folded into the original cap planning models once we have it implemented across the board. aurora / rds are a little tricky for example

@homatthew homatthew force-pushed the mho/model-cost-methods-reduced branch 3 times, most recently from 3264f6e to 5911bc0 Compare January 20, 2026 23:05
@homatthew homatthew marked this pull request as ready for review January 21, 2026 01:06
)
]
# Calculate service costs (network + backup) using the model's service_costs method
# This is defined later in NflxCassandraCapacityModel but we call it here for DRY
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. This is a weird GPT comment. I will fix this

@homatthew homatthew merged commit 5911bc0 into Netflix-Skunkworks:mho/cost-baseline-and-methods Jan 21, 2026
4 checks passed
@homatthew
Copy link
Contributor Author

homatthew commented Jan 21, 2026

I did not mean to merge this 🫤 . I'll recreate it in stacked commit style

@homatthew
Copy link
Contributor Author

Continued in #212

@homatthew homatthew deleted the mho/model-cost-methods-reduced branch February 18, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments