summaryrefslogtreecommitdiff
path: root/robusta_krr/strategies
diff options
context:
space:
mode:
authorПавел Жуков <33721692+LeaveMyYard@users.noreply.github.com>2023-05-15 18:23:48 +0300
committerПавел Жуков <33721692+LeaveMyYard@users.noreply.github.com>2023-05-15 18:23:48 +0300
commit7a17e9a1df01776875e8b4f6a71b833100a01d5c (patch)
tree7d89c56f253e97683c5eac943994d75a84e293a0 /robusta_krr/strategies
parentfabf1b4fd2c1ae0245d2f0c6000ff8d9d197a29e (diff)
[MAIN-169] Minor improve for strategy description
Diffstat (limited to 'robusta_krr/strategies')
-rw-r--r--robusta_krr/strategies/simple.py14
1 files changed, 1 insertions, 13 deletions
diff --git a/robusta_krr/strategies/simple.py b/robusta_krr/strategies/simple.py
index f528ba8..f99f28b 100644
--- a/robusta_krr/strategies/simple.py
+++ b/robusta_krr/strategies/simple.py
@@ -1,7 +1,6 @@
import pydantic as pd
import numpy as np
from numpy.typing import NDArray
-from textwrap import dedent
from robusta_krr.core.abstract.strategies import (
BaseStrategy,
@@ -45,27 +44,16 @@ class SimpleStrategy(BaseStrategy[SimpleStrategySettings]):
"""
A simple strategy that uses the {cpu_percentile} percentile for CPU and
the peak memory usage plus {memory_buffer_percentage}% buffer for memory.
- (Exact numbers can be setup in the settings)
For CPU, we set a request at the {cpu_percentile} percentile with no limit.
Meaning, in {cpu_percentile}% of the cases, your CPU request will be sufficient.
- For the remaining - we set no limit.
-
- This means your pod can burst and use any CPU available on the node - e.g.
- CPU that other pods requested but aren't using right now.
For memory, we take the maximum value over the past week and add a {memory_buffer_percentage}% buffer.
+ We set both request and limit to this value.
"""
__display_name__ = "simple"
- @property
- def description(self) -> str | None:
- if self.__doc__ is None:
- return None
-
- return dedent(self.__doc__.format_map(self.settings.dict())).strip()
-
def run(self, history_data: HistoryData, object_data: K8sObjectData) -> RunResult:
cpu_usage = self.settings.calculate_cpu_proposal(history_data[ResourceType.CPU])
memory_usage = self.settings.calculate_memory_proposal(history_data[ResourceType.Memory])