-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Anomaly detection - peak/trough detection and caching of matrix profle (
#1081) This PR has multiple changes: - Trough and peak detection using interquartile range - Caching of matrix profile - Changes to the detect end point to support historic time steps separated from current time steps of a time series --------- Co-authored-by: Zachary Collins <zachary.collins@sentry.io>
- Loading branch information
Showing
16 changed files
with
643 additions
and
122 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""Migration | ||
Revision ID: 00a7fb4f4911 | ||
Revises: 96e56e375579 | ||
Create Date: 2024-08-27 21:59:23.740336 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "00a7fb4f4911" | ||
down_revision = "96e56e375579" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("dynamic_alert_time_series", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("anomaly_type", sa.String(), nullable=False)) | ||
batch_op.add_column(sa.Column("anomaly_score", sa.Float(), nullable=False)) | ||
batch_op.add_column(sa.Column("anomaly_algo_data", sa.JSON(), nullable=True)) | ||
|
||
with op.batch_alter_table("dynamic_alerts", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("anomaly_algo_data", sa.JSON(), nullable=False)) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("dynamic_alerts", schema=None) as batch_op: | ||
batch_op.drop_column("anomaly_algo_data") | ||
|
||
with op.batch_alter_table("dynamic_alert_time_series", schema=None) as batch_op: | ||
batch_op.drop_column("anomaly_algo_data") | ||
batch_op.drop_column("anomaly_score") | ||
batch_op.drop_column("anomaly_type") | ||
|
||
# ### end Alembic commands ### |
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,21 @@ | ||
"""empty message | ||
Revision ID: 141e9df277be | ||
Revises: 00a7fb4f4911 | ||
Create Date: 2024-09-03 18:26:51.007139 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "141e9df277be" | ||
down_revision = "00a7fb4f4911" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
pass | ||
|
||
|
||
def downgrade(): | ||
pass |
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,21 @@ | ||
"""empty message | ||
Revision ID: aeeaf482e659 | ||
Revises: 141e9df277be, 2e22d272d3b8 | ||
Create Date: 2024-09-03 19:07:16.527261 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "aeeaf482e659" | ||
down_revision = ("141e9df277be", "2e22d272d3b8") | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
pass | ||
|
||
|
||
def downgrade(): | ||
pass |
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.