cli-setu 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/supervisor.js +12 -0
package/package.json
CHANGED
package/src/supervisor.js
CHANGED
|
@@ -545,12 +545,24 @@ function flushOutputBuffer() {
|
|
|
545
545
|
// Still serialized against any send already in flight, so batches
|
|
546
546
|
// themselves can never arrive out of order relative to each other.
|
|
547
547
|
sendInFlight = sendInFlight.then(async () => {
|
|
548
|
+
// TEMPORARY diagnostic (remove once the real lag source is found):
|
|
549
|
+
// measures the full fetch() round trip to the Backend, isolating "is
|
|
550
|
+
// the laptop's own network connection to the Backend slow" from
|
|
551
|
+
// Azure's broadcast time (measured separately, server-side, in
|
|
552
|
+
// auth-server.js's /relay/terminal-output handler) and from this
|
|
553
|
+
// batch's own BATCH_WINDOW_MS wait (not included here - that delay is
|
|
554
|
+
// intentional, not a bug).
|
|
555
|
+
const sendStart = Date.now();
|
|
548
556
|
try {
|
|
549
557
|
await fetch(`${AUTH_SERVER}/relay/terminal-output`, {
|
|
550
558
|
method: 'POST',
|
|
551
559
|
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${deviceToken}` },
|
|
552
560
|
body: JSON.stringify({ sessionId: SESSION_ID, seq: ++outputSeq, data: batch }),
|
|
553
561
|
});
|
|
562
|
+
const sendMs = Date.now() - sendStart;
|
|
563
|
+
if (sendMs > 150) {
|
|
564
|
+
log(`[perf] terminal-output POST took ${sendMs}ms (bytes=${batch.length})`);
|
|
565
|
+
}
|
|
554
566
|
} catch (err) {
|
|
555
567
|
// A dropped terminal.output batch isn't fatal the way a dropped
|
|
556
568
|
// confirmation would be - the next batch (or a fresh session.attach
|