|
@@ -149,16 +149,18 @@ def load_data(platform, default=None, sample_name=None):
|
|
|
if platform in ("csp", "hkpk", "expectct", "expectstaple"):
|
|
|
return data
|
|
|
|
|
|
- # Transaction events need timestamp data set to something current.
|
|
|
- if platform == "transaction":
|
|
|
- now = timezone.now()
|
|
|
- now_time = to_timestamp(now)
|
|
|
- start_time = to_timestamp(now - timedelta(seconds=2))
|
|
|
- data.setdefault("timestamp", now_time)
|
|
|
- data.setdefault("start_timestamp", start_time)
|
|
|
- for span in data["spans"]:
|
|
|
- span.setdefault("timestamp", now_time)
|
|
|
- span.setdefault("start_timestamp", start_time)
|
|
|
+ # Fixing up timestamps for all events
|
|
|
+ now = timezone.now()
|
|
|
+ now_time = to_timestamp(now)
|
|
|
+ start_time = to_timestamp(now - timedelta(seconds=2))
|
|
|
+ data.setdefault("timestamp", now_time)
|
|
|
+
|
|
|
+ if data.get("type") == "transaction":
|
|
|
+ data["start_timestamp"] = start_time
|
|
|
+
|
|
|
+ for span in data.get("spans") or ():
|
|
|
+ span.setdefault("timestamp", now_time)
|
|
|
+ span.setdefault("start_timestamp", start_time)
|
|
|
|
|
|
data["platform"] = platform
|
|
|
# XXX: Message is a legacy alias for logentry. Do not overwrite if set.
|