Improve message layout
This commit is contained in:
@@ -730,6 +730,8 @@ def _serialize_messages_with_artifacts(
|
||||
for item in serialized:
|
||||
item["gap_fragments"] = []
|
||||
item["metric_fragments"] = []
|
||||
item["block_gap_ms"] = None
|
||||
item["block_gap_display"] = ""
|
||||
|
||||
counterpart_identifiers = set(counterpart_identifiers or [])
|
||||
snapshot = (
|
||||
@@ -749,6 +751,17 @@ def _serialize_messages_with_artifacts(
|
||||
current_outgoing = _message_is_outgoing_for_analysis(
|
||||
msg, counterpart_identifiers
|
||||
)
|
||||
if (
|
||||
prev_msg is not None
|
||||
and prev_ts is not None
|
||||
and prev_outgoing is not None
|
||||
and current_outgoing == prev_outgoing
|
||||
and current_ts >= prev_ts
|
||||
):
|
||||
block_gap_ms = current_ts - prev_ts
|
||||
serialized[idx]["block_gap_ms"] = int(block_gap_ms)
|
||||
serialized[idx]["block_gap_display"] = _format_gap_duration(block_gap_ms)
|
||||
|
||||
if (
|
||||
prev_msg is not None
|
||||
and prev_ts is not None
|
||||
|
||||
Reference in New Issue
Block a user