Skip to content

Commit

Permalink
Fix custom strategy example
Browse files Browse the repository at this point in the history
  • Loading branch information
LeaveMyYard committed Mar 4, 2024
1 parent 9fbf803 commit 356bd75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/custom_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import robusta_krr
from robusta_krr.api.models import K8sObjectData, MetricsPodData, ResourceRecommendation, ResourceType, RunResult
from robusta_krr.api.strategies import BaseStrategy, StrategySettings
from robusta_krr.core.integrations.prometheus.metrics import MaxCPULoader, MaxMemoryLoader
from robusta_krr.core.integrations.prometheus.metrics import MaxMemoryLoader, PercentileCPULoader


# Providing description to the settings will make it available in the CLI help
Expand All @@ -22,7 +22,7 @@ class CustomStrategy(BaseStrategy[CustomStrategySettings]):

display_name = "custom" # The name of the strategy
rich_console = True # Whether to use rich console for the CLI
metrics = [MaxCPULoader, MaxMemoryLoader] # The metrics to use for the strategy
metrics = [PercentileCPULoader(90), MaxMemoryLoader] # The metrics to use for the strategy

def run(self, history_data: MetricsPodData, object_data: K8sObjectData) -> RunResult:
return {
Expand Down

0 comments on commit 356bd75

Please sign in to comment.