summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorLeaveMyYard <zhukovpavel2001@gmail.com>2024-03-04 11:39:30 +0200
committerLeaveMyYard <zhukovpavel2001@gmail.com>2024-03-04 11:39:30 +0200
commit356bd75fd550e2affb1125eece4fe0db1a49c5a7 (patch)
treecb21d26d01e8d47e0bfab42b60694c62f8139a94 /examples
parent9fbf803164e87d95b043a39d025424b6808d731e (diff)
Fix custom strategy example
Diffstat (limited to 'examples')
-rw-r--r--examples/custom_strategy.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/custom_strategy.py b/examples/custom_strategy.py
index c3623ef..f9e281d 100644
--- a/examples/custom_strategy.py
+++ b/examples/custom_strategy.py
@@ -5,7 +5,7 @@ import pydantic as pd
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 {