Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions simvue/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -1795,7 +1795,7 @@ def create_metric_range_alert(
rule: typing.Literal["is inside range", "is outside range"],
*,
description: str | None = None,
window: pydantic.PositiveInt = 5,
window: pydantic.PositiveInt | None = None,
frequency: pydantic.PositiveInt = 1,
aggregation: typing.Literal[
"average", "sum", "at least one", "all"
Expand Down Expand Up @@ -1823,8 +1823,9 @@ def create_metric_range_alert(
* is outside range - metric value falls outside of value range.
description : str, optional
description for this alert, default None
window : PositiveInt, optional
time period in seconds over which metrics are averaged, by default 5
window : PositiveInt | None, optional
time period in seconds over which metrics are averaged,
default of None sets this to be the same as frequency.
frequency : PositiveInt, optional
frequency at which to check alert condition in seconds, by default 1
aggregation : Literal['average', 'sum', 'at least one', 'all'], optional
Expand Down Expand Up @@ -1852,7 +1853,7 @@ def create_metric_range_alert(
name=name,
description=description,
metric=metric,
window=window,
window=window or frequency,
aggregation=aggregation,
notification=notification,
rule=rule,
Expand All @@ -1877,7 +1878,7 @@ def create_metric_threshold_alert(
rule: typing.Literal["is above", "is below"],
*,
description: str | None = None,
window: pydantic.PositiveInt = 5,
window: pydantic.PositiveInt | None = None,
frequency: pydantic.PositiveInt = 1,
aggregation: typing.Literal[
"average", "sum", "at least one", "all"
Expand All @@ -1904,8 +1905,9 @@ def create_metric_threshold_alert(
* is below - value is below threshold.
description : str, optional
description for this alert, default None
window : PositiveInt, optional
time period in seconds over which metrics are averaged, by default 5
window : PositiveInt | None, optional
time period in seconds over which metrics are averaged,
default of None sets this to be the same as frequency.
frequency : PositiveInt, optional
frequency at which to check alert condition in seconds, by default 1
aggregation : Literal['average', 'sum', 'at least one', 'all'], optional
Expand Down Expand Up @@ -1935,7 +1937,7 @@ def create_metric_threshold_alert(
description=description,
threshold=threshold,
rule=rule,
window=window,
window=window or frequency,
frequency=frequency,
aggregation=aggregation,
notification=notification,
Expand Down