added gpr speed tracking
This commit is contained in:
@@ -48,3 +48,7 @@ class ByteCursor:
|
||||
data = self.payload[self.offset : self.offset + size]
|
||||
self.offset += size
|
||||
return data
|
||||
|
||||
def remaining_bytes(self) -> int:
|
||||
"""Return unread byte count."""
|
||||
return len(self.payload) - self.offset
|
||||
|
||||
@@ -54,7 +54,21 @@ def decode_trace_collection(payload: bytes, expected_magic: int) -> SweepCollect
|
||||
)
|
||||
)
|
||||
|
||||
return SweepCollection(collection_id=collection_id, monotonic_ns=monotonic_ns, traces=traces)
|
||||
capture_start_ns = 0
|
||||
capture_end_ns = 0
|
||||
if cursor.remaining_bytes() == 16:
|
||||
capture_start_ns = cursor.read_u64()
|
||||
capture_end_ns = cursor.read_u64()
|
||||
elif cursor.remaining_bytes() != 0:
|
||||
raise ValueError("Unexpected trailing bytes in trace collection")
|
||||
|
||||
return SweepCollection(
|
||||
collection_id=collection_id,
|
||||
monotonic_ns=monotonic_ns,
|
||||
traces=traces,
|
||||
capture_start_ns=capture_start_ns,
|
||||
capture_end_ns=capture_end_ns,
|
||||
)
|
||||
|
||||
|
||||
def decode_result_collection(payload: bytes) -> ResultCollection:
|
||||
|
||||
Reference in New Issue
Block a user