From bdd50f8074494508ead4d3ea4bc8a9c8c11eb711 Mon Sep 17 00:00:00 2001 From: Avi-Robusta <97387909+Avi-Robusta@users.noreply.github.com> Date: Thu, 24 Aug 2023 09:43:12 +0300 Subject: added minimum reccomendation from cmd (#134) * added minimum reccomendation from cmd need to add to readme * re-named settings * added config info to readme --- README.md | 5 +++++ robusta_krr/core/models/config.py | 2 +- robusta_krr/main.py | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c8a5155..8b7a40c 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,11 @@ If you want to see additional debug logs: krr simple -v ``` +Other helpful flags: +* `--cpu-min` Sets the minimum recommended cpu value in millicores +* `--mem-min` Sets the minimum recommended memory value in MB +* `--history_duration` The duration of the prometheus history data to use (in hours) + More specific information on Strategy Settings can be found using ```sh diff --git a/robusta_krr/core/models/config.py b/robusta_krr/core/models/config.py index a3b7be0..d170ef5 100644 --- a/robusta_krr/core/models/config.py +++ b/robusta_krr/core/models/config.py @@ -21,7 +21,7 @@ class Config(pd.BaseSettings): selector: Optional[str] = None # Value settings - cpu_min_value: int = pd.Field(100, ge=0) # in millicores + cpu_min_value: int = pd.Field(10, ge=0) # in millicores memory_min_value: int = pd.Field(100, ge=0) # in megabytes # Prometheus Settings diff --git a/robusta_krr/main.py b/robusta_krr/main.py index b9a2d3e..4a114e4 100644 --- a/robusta_krr/main.py +++ b/robusta_krr/main.py @@ -169,6 +169,18 @@ def load_commands() -> None: help="Adds the token needed to query Coralogix managed prometheus.", rich_help_panel="Prometheus Coralogix Settings", ), + cpu_min_value: int = typer.Option( + 10, + "--cpu-min", + help="Sets the minimum recommended cpu value in millicores.", + rich_help_panel="Recommendation Settings", + ), + memory_min_value: int = typer.Option( + 100, + "--mem-min", + help="Sets the minimum recommended memory value in MB.", + rich_help_panel="Recommendation Settings", + ), max_workers: int = typer.Option( 10, "--max-workers", @@ -209,6 +221,8 @@ def load_commands() -> None: max_workers=max_workers, format=format, verbose=verbose, + cpu_min_value=cpu_min_value, + memory_min_value=memory_min_value, quiet=quiet, log_to_stderr=log_to_stderr, file_output=file_output, -- cgit v1.2.3