Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support training for latency based anomalies specifically for perf-an… #380

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN apt-get update \
WORKDIR /app
COPY poetry.lock pyproject.toml ./

RUN poetry install --without dev --no-root --extras "${INSTALL_EXTRAS}" \
RUN poetry install --without dev --no-root --extras "redis druid rds" \
&& poetry run pip install --no-cache-dir "torch>=2.0,<3.0" --index-url https://download.pytorch.org/whl/cpu \
&& poetry run pip install --no-cache-dir "lightning[pytorch]" \
&& rm -rf $POETRY_CACHE_DIR \
Expand Down
14 changes: 13 additions & 1 deletion numalogic/connectors/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,27 @@
datasource: str
dimensions: list[str] = field(default_factory=list)
aggregations: dict = field(default_factory=dict)
post_aggregations: dict = field(default_factory=dict)
group_by: list[str] = field(default_factory=list)
pivot: Pivot = field(default_factory=lambda: Pivot())
granularity: str = "minute"

def __post_init__(self):
from pydruid.utils.aggregators import doublesum

Check failure on line 52 in numalogic/connectors/_config.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F401)

numalogic/connectors/_config.py:52:47: F401 `pydruid.utils.aggregators.doublesum` imported but unused
from pydruid.utils import postaggregator, aggregators

Check failure on line 53 in numalogic/connectors/_config.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F401)

numalogic/connectors/_config.py:53:51: F401 `pydruid.utils.aggregators` imported but unused
from numalogic.connectors.druid import postaggregator as _post_agg
from numalogic.connectors.druid import aggregators as _agg

if not self.aggregations:
self.aggregations = {"count": doublesum("count")}
self.aggregations = {
"agg_out": _agg.quantiles_doubles_sketch("valuesDoublesSketch", "agg0", 64)
}
if not self.post_aggregations:
self.post_aggregations = {
"p90": _post_agg.QuantilesDoublesSketchToQuantile(
output_name="agg_out", field=postaggregator.Field("agg_out"), fraction=0.90
)
}


@dataclass
Expand Down
1 change: 1 addition & 0 deletions numalogic/udfs/trainer/_druid.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def fetch_data(self, payload: TrainerPayload) -> Optional[pd.DataFrame]:
delay=self.dataconn_conf.delay_hrs,
granularity=_fetcher_conf.granularity,
aggregations=dict(_fetcher_conf.aggregations),
post_aggregations=dict(_fetcher_conf.post_aggregations),
group_by=list(_fetcher_conf.group_by),
pivot=_fetcher_conf.pivot,
hours=_conf.numalogic_conf.trainer.train_hours,
Expand Down
Loading