diff options
| author | LeaveMyYard <zhukovpavel2001@gmail.com> | 2023-08-18 14:07:46 +0300 |
|---|---|---|
| committer | LeaveMyYard <zhukovpavel2001@gmail.com> | 2023-08-18 14:07:46 +0300 |
| commit | 1253ebfbdcaa404ff02eafde31ad331097d464e2 (patch) | |
| tree | 0253ea1665d24deeb961c7d778d46c0dc620c268 /robusta_krr | |
| parent | ef4c0deff3733cdc1d336b054239e20ff10ffd99 (diff) | |
Change default step to 1.25 minutes
Diffstat (limited to 'robusta_krr')
| -rw-r--r-- | robusta_krr/core/abstract/strategies.py | 2 | ||||
| -rw-r--r-- | robusta_krr/core/integrations/prometheus/metrics/base.py | 2 | ||||
| -rw-r--r-- | robusta_krr/strategies/simple.py | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/robusta_krr/core/abstract/strategies.py b/robusta_krr/core/abstract/strategies.py index 9e6b269..204341f 100644 --- a/robusta_krr/core/abstract/strategies.py +++ b/robusta_krr/core/abstract/strategies.py @@ -49,7 +49,7 @@ class StrategySettings(pd.BaseModel): history_duration: float = pd.Field( 24 * 7 * 2, ge=1, description="The duration of the history data to use (in hours)." ) - timeframe_duration: float = pd.Field(2, ge=1, description="The step for the history data (in minutes).") + timeframe_duration: float = pd.Field(1.25, gt=0, description="The step for the history data (in minutes).") @property def history_timedelta(self) -> datetime.timedelta: diff --git a/robusta_krr/core/integrations/prometheus/metrics/base.py b/robusta_krr/core/integrations/prometheus/metrics/base.py index 87ee583..bf44d60 100644 --- a/robusta_krr/core/integrations/prometheus/metrics/base.py +++ b/robusta_krr/core/integrations/prometheus/metrics/base.py @@ -142,7 +142,7 @@ class PrometheusMetric(BaseMetric, Configurable): ResourceHistoryData: An instance of the ResourceHistoryData class representing the loaded metrics. """ - step_str = "75s" # self._step_to_string(step) + step_str = f"{round(step.total_seconds())}s" duration_str = self._step_to_string(period) query = self.get_query(object, duration_str, step_str) diff --git a/robusta_krr/strategies/simple.py b/robusta_krr/strategies/simple.py index f4adee3..e15c4fa 100644 --- a/robusta_krr/strategies/simple.py +++ b/robusta_krr/strategies/simple.py @@ -43,6 +43,8 @@ class SimpleStrategy(BaseStrategy[SimpleStrategySettings]): """ CPU request: {cpu_percentile}% percentile, limit: unset Memory request: max + {memory_buffer_percentage}%, limit: max + {memory_buffer_percentage}% + History: {history_duration} hours + Step: {timeframe_duration} minutes This strategy does not work with objects with HPA defined (Horizontal Pod Autoscaler). If HPA is defined for CPU or Memory, the strategy will return "?" for that resource. |
