Skip to content

Commit d91a8bc

Browse files
chore(examples): log network RTT to separate transport from pipeline latency
glass2glass much larger than rtt means the media pipeline (encode, jitter buffer, geography of the extra cloud hop) is the cost. glass2glass close to rtt means it is just the network round trip. This tells the two apart.
1 parent 757aa95 commit d91a8bc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • examples/python/modal-mock-inference

examples/python/modal-mock-inference/robot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def on_action(action: Action) -> None:
144144
f"replies={stats.replies} dropped={stats.dropped} "
145145
f"glass2glass={fmt_us(stats.glass_us)} codec_lag={fmt_us(stats.codec_us)} "
146146
f"e2e={fmt_us(m.policy.e2e_us_p50)}/{fmt_us(m.policy.e2e_us_p95)} "
147-
f"active={robot.active_operator()}"
147+
f"rtt={fmt_us(m.rtt.rtt_us_last)} active={robot.active_operator()}"
148148
)
149149
last_log = now
150150

@@ -161,6 +161,7 @@ def on_action(action: Action) -> None:
161161
print()
162162
print("[robot] final:")
163163
print(f" glass-to-glass p50/p95: {fmt_us(m.policy.e2e_us_p50)} / {fmt_us(m.policy.e2e_us_p95)}")
164+
print(f" network rtt (last): {fmt_us(m.rtt.rtt_us_last)}")
164165
print(f" codec lag (last): {fmt_us(stats.codec_us)}")
165166
print(f" frames sent: {DURATION_S * FPS}")
166167
print(f" replies / dropped: {stats.replies} / {stats.dropped}")

0 commit comments

Comments
 (0)