Skip to content

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
armenzg committed Sep 26, 2023
1 parent 9a33447 commit 5361567
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/sentry/snuba/metrics/fields/snql.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def rate_snql_factory(
numerator: float,
denominator: float = 1.0,
alias: Optional[str] = None,
):
) -> Function:
return Function(
"divide",
[
Expand Down
23 changes: 3 additions & 20 deletions tests/sentry/relay/config/test_metric_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,27 +433,10 @@ def test_get_metric_extraction_config_with_apdex(default_project):


@django_db_all
def test_get_metric_extraction_config_with_epm(default_project):
@pytest.mark.parametrize("metric", [("epm()"), ("eps()")])
def test_get_metric_extraction_config_with_no_tag_spec(default_project, metric):
with Feature({ON_DEMAND_METRICS: True, ON_DEMAND_METRICS_WIDGETS: True}):
create_widget(["epm()"], "transaction.duration:>=1000", default_project)

config = get_metric_extraction_config(default_project)

assert config
assert len(config["metrics"]) == 1
assert config["metrics"][0] == {
"category": "transaction",
"condition": {"name": "event.duration", "op": "gte", "value": 1000.0},
"field": None,
"mri": "c:transactions/on_demand@none",
"tags": [{"key": "query_hash", "value": ANY}],
}


@django_db_all
def test_get_metric_extraction_config_with_eps(default_project):
with Feature({ON_DEMAND_METRICS: True, ON_DEMAND_METRICS_WIDGETS: True}):
create_widget(["eps()"], "transaction.duration:>=1000", default_project)
create_widget([metric], "transaction.duration:>=1000", default_project)

config = get_metric_extraction_config(default_project)

Expand Down

0 comments on commit 5361567

Please sign in to comment.