Fix type error in process events. Rename docker compose to compose
This commit is contained in:
1 parent
220a004bae
commit
dd4f913743
7 files changed
+11
-6
No files matched your search
@@ -1,4 +1,7 @@
|
||||
# v
|
||||
#
|
||||
|
||||
|
||||
# v5.1.0
|
||||
|
||||
- Fix: Performance transaction group method no longer nullable, which in rare conditions could lead to duplicate and invalid groups
|
||||
- Fix: Reject transaction events that are older than GLITCHTIP_MAX_TRANSACTION_EVENT_LIFE_DAYS
|
||||
|
||||
@@ -1153,7 +1153,7 @@ def process_transaction_events(ingest_events: list[InterchangeTransactionEvent])
|
||||
second=0, microsecond=0
|
||||
)
|
||||
group_id = perf_transaction.group_id
|
||||
duration = perf_transaction.duration_ms
|
||||
duration: int | None = perf_transaction.duration_ms
|
||||
|
||||
stats_bucket = group_stats[minute_timestamp][group_id]
|
||||
|
||||
@@ -1162,8 +1162,9 @@ def process_transaction_events(ingest_events: list[InterchangeTransactionEvent])
|
||||
stats_bucket["organization_id"] = perf_transaction.organization_id
|
||||
|
||||
stats_bucket["count"] += 1
|
||||
stats_bucket["total_duration"] += duration
|
||||
stats_bucket["sum_of_squares_duration"] += duration**2
|
||||
if duration:
|
||||
stats_bucket["total_duration"] += duration
|
||||
stats_bucket["sum_of_squares_duration"] += duration**2
|
||||
update_transaction_group_stats(group_stats)
|
||||
|
||||
data_stats: defaultdict[datetime, defaultdict[int, int]] = defaultdict(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import uuid
|
||||
from datetime import timedelta
|
||||
|
||||
from django.contrib.postgres.search import SearchVectorField
|
||||
from django.db import models
|
||||
@@ -61,12 +62,12 @@ class TransactionEvent(PostgresPartitionedModel, models.Model):
|
||||
return str(self.trace_id)
|
||||
|
||||
@property
|
||||
def duration(self):
|
||||
def duration(self) -> timedelta | None:
|
||||
if self.timestamp:
|
||||
return self.timestamp - self.start_timestamp
|
||||
|
||||
@property
|
||||
def duration_ms(self):
|
||||
def duration_ms(self) -> int | None:
|
||||
"""Optimized method for getting duration in milliseconds"""
|
||||
if duration := self.duration:
|
||||
return (
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user