-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(workflow_engine): Split fast and slow condition evaluation (#84275)
## Description This PR splits the fast / slow conditions when we evaluate the condition group. This method will use the condition group logic type to decide when to return slow conditions or if we can short circuit those conditions. Will Create a follow-up PR for enqueuing the slow conditions to the redis buffer (this was getting large) - Here's the draft of that PR, just need to add tests #84283
- Loading branch information
1 parent
959ab36
commit 4826b4f
Showing
11 changed files
with
383 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from sentry.workflow_engine.models.data_condition import DataCondition, is_slow_condition | ||
|
||
|
||
def split_conditions_by_speed( | ||
conditions: list[DataCondition], | ||
) -> tuple[list[DataCondition], list[DataCondition]]: | ||
fast_conditions: list[DataCondition] = [] | ||
slow_conditions: list[DataCondition] = [] | ||
|
||
for condition in conditions: | ||
if is_slow_condition(condition): | ||
slow_conditions.append(condition) | ||
else: | ||
fast_conditions.append(condition) | ||
|
||
return fast_conditions, slow_conditions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.