Skip to content

Commit 657d08b

Browse files
Revert "chore(performance-issues): Create experimental N+1 API Call detector (#90070)"
This reverts commit 1349128. Co-authored-by: asottile-sentry <103459774+asottile-sentry@users.noreply.github.com>
1 parent 64362bb commit 657d08b

File tree

10 files changed

+21
-802
lines changed

10 files changed

+21
-802
lines changed

src/sentry/issues/grouptype.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -382,16 +382,6 @@ class PerformanceNPlusOneAPICallsGroupType(GroupType):
382382
released = True
383383

384384

385-
@dataclass(frozen=True)
386-
class PerformanceNPlusOneAPICallsExperimentalGroupType(GroupType):
387-
type_id = 1910
388-
slug = "performance_n_plus_one_api_calls_experimental"
389-
description = "N+1 API Call (Experimental)"
390-
category = GroupCategory.PERFORMANCE.value
391-
default_priority = PriorityLevel.LOW
392-
released = False
393-
394-
395385
@dataclass(frozen=True)
396386
class PerformanceMNPlusOneDBQueriesGroupType(PerformanceGroupTypeDefaults, GroupType):
397387
type_id = 1011

src/sentry/notifications/utils/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from sentry.integrations.services.integration import integration_service
2222
from sentry.issues.grouptype import (
2323
PerformanceConsecutiveDBQueriesGroupType,
24-
PerformanceNPlusOneAPICallsExperimentalGroupType,
2524
PerformanceNPlusOneAPICallsGroupType,
2625
PerformanceRenderBlockingAssetSpanGroupType,
2726
)
@@ -337,7 +336,7 @@ def occurrence_perf_to_email_html(context: Any) -> str:
337336

338337

339338
def get_spans(
340-
entries: list[dict[str, list[dict[str, str | float]] | str]],
339+
entries: list[dict[str, list[dict[str, str | float]] | str]]
341340
) -> list[dict[str, str | float]] | None:
342341
"""Get the given event's spans"""
343342
if not len(entries):
@@ -497,10 +496,7 @@ def from_problem_and_spans(
497496
spans: list[dict[str, str | float]] | None,
498497
event: Event | None = None,
499498
) -> PerformanceProblemContext:
500-
if problem.type in (
501-
PerformanceNPlusOneAPICallsGroupType,
502-
PerformanceNPlusOneAPICallsExperimentalGroupType,
503-
):
499+
if problem.type == PerformanceNPlusOneAPICallsGroupType:
504500
return NPlusOneAPICallProblemContext(problem, spans, event)
505501
if problem.type == PerformanceConsecutiveDBQueriesGroupType:
506502
return ConsecutiveDBQueriesProblemContext(problem, spans, event)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from .consecutive_db_detector import ConsecutiveDBSpanDetector # NOQA
2+
from .consecutive_http_detector import ConsecutiveHTTPSpanDetector # NOQA
3+
from .http_overhead_detector import HTTPOverheadDetector # NOQA
4+
from .io_main_thread_detector import DBMainThreadDetector, FileIOMainThreadDetector # NOQA
5+
from .large_payload_detector import LargeHTTPPayloadDetector # NOQA
6+
from .mn_plus_one_db_span_detector import MNPlusOneDBSpanDetector # NOQA
7+
from .n_plus_one_api_calls_detector import NPlusOneAPICallsDetector # NOQA
8+
from .n_plus_one_db_span_detector import ( # NOQA
9+
NPlusOneDBSpanDetector,
10+
NPlusOneDBSpanDetectorExtended,
11+
)
12+
from .render_blocking_asset_span_detector import RenderBlockingAssetSpanDetector # NOQA
13+
from .slow_db_query_detector import SlowDBQueryDetector # NOQA
14+
from .uncompressed_asset_detector import UncompressedAssetSpanDetector # NOQA

src/sentry/utils/performance_issues/detectors/experiments/__init__.py

Whitespace-only changes.

src/sentry/utils/performance_issues/detectors/experiments/n_plus_one_api_calls_detector.py

Lines changed: 0 additions & 310 deletions
This file was deleted.

src/sentry/utils/performance_issues/detectors/n_plus_one_api_calls_detector.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
from sentry.issues.issue_occurrence import IssueEvidence
1515
from sentry.models.organization import Organization
1616
from sentry.models.project import Project
17-
from sentry.utils.performance_issues.base import (
17+
from sentry.utils.performance_issues.detectors.utils import get_total_span_duration
18+
19+
from ..base import (
1820
DetectorType,
1921
PerformanceDetector,
2022
fingerprint_http_spans,
@@ -23,9 +25,8 @@
2325
get_url_from_span,
2426
parameterize_url,
2527
)
26-
from sentry.utils.performance_issues.detectors.utils import get_total_span_duration
27-
from sentry.utils.performance_issues.performance_problem import PerformanceProblem
28-
from sentry.utils.performance_issues.types import PerformanceProblemsMap, Span
28+
from ..performance_problem import PerformanceProblem
29+
from ..types import PerformanceProblemsMap, Span
2930

3031

3132
class NPlusOneAPICallsDetector(PerformanceDetector):

0 commit comments

Comments
 (0)