|
@@ -1424,7 +1424,7 @@ class PerformanceMetricsLayerTestCase(BaseMetricsLayerTestCase, TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_team_key_transactions_my_teams(self):
|
|
def test_team_key_transactions_my_teams(self):
|
|
- for idx, (transaction, value) in enumerate(
|
|
+ for minutes, (transaction, value) in enumerate(
|
|
(("foo_transaction", 1), ("bar_transaction", 1), ("baz_transaction", 0.5))
|
|
(("foo_transaction", 1), ("bar_transaction", 1), ("baz_transaction", 0.5))
|
|
):
|
|
):
|
|
self.store_performance_metric(
|
|
self.store_performance_metric(
|
|
@@ -1432,7 +1432,7 @@ class PerformanceMetricsLayerTestCase(BaseMetricsLayerTestCase, TestCase):
|
|
name=TransactionMRI.DURATION.value,
|
|
name=TransactionMRI.DURATION.value,
|
|
tags={"transaction": transaction},
|
|
tags={"transaction": transaction},
|
|
value=value,
|
|
value=value,
|
|
- minutes_before_now=idx,
|
|
+ minutes_before_now=minutes,
|
|
)
|
|
)
|
|
|
|
|
|
metrics_query = self.build_metrics_query(
|
|
metrics_query = self.build_metrics_query(
|
|
@@ -1770,22 +1770,18 @@ class PerformanceMetricsLayerTestCase(BaseMetricsLayerTestCase, TestCase):
|
|
use_case_id=UseCaseKey.PERFORMANCE,
|
|
use_case_id=UseCaseKey.PERFORMANCE,
|
|
)
|
|
)
|
|
|
|
|
|
- @freeze_time("2022-09-22 11:07:00")
|
|
|
|
def test_team_key_transaction_as_condition(self):
|
|
def test_team_key_transaction_as_condition(self):
|
|
now = timezone.now()
|
|
now = timezone.now()
|
|
|
|
|
|
- for idx, (transaction, value) in enumerate(
|
|
+ for minutes, (transaction, value) in enumerate(
|
|
(("foo_transaction", 1), ("bar_transaction", 1), ("baz_transaction", 0.5))
|
|
(("foo_transaction", 1), ("bar_transaction", 1), ("baz_transaction", 0.5))
|
|
):
|
|
):
|
|
- self.store_metric(
|
|
+ self.store_performance_metric(
|
|
- org_id=self.organization.id,
|
|
|
|
- project_id=self.project.id,
|
|
|
|
type="distribution",
|
|
type="distribution",
|
|
name=TransactionMRI.DURATION.value,
|
|
name=TransactionMRI.DURATION.value,
|
|
tags={"transaction": transaction},
|
|
tags={"transaction": transaction},
|
|
- timestamp=(now - timedelta(minutes=idx)).timestamp(),
|
|
|
|
value=value,
|
|
value=value,
|
|
- use_case_id=UseCaseKey.PERFORMANCE,
|
|
+ minutes_before_now=minutes,
|
|
)
|
|
)
|
|
|
|
|
|
metrics_query = MetricsQuery(
|
|
metrics_query = MetricsQuery(
|