From 356bd75fd550e2affb1125eece4fe0db1a49c5a7 Mon Sep 17 00:00:00 2001 From: LeaveMyYard Date: Mon, 4 Mar 2024 11:39:30 +0200 Subject: [PATCH] Fix custom strategy example --- examples/custom_strategy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/custom_strategy.py b/examples/custom_strategy.py index c3623ef6..f9e281d1 100644 --- a/examples/custom_strategy.py +++ b/examples/custom_strategy.py @@ -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 @@ -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 {