From eb8a8632226eed62c76d40e042a4482e2d21d820 Mon Sep 17 00:00:00 2001 From: James Babcock Date: Tue, 1 Sep 2026 11:57:13 -0700 Subject: [PATCH] Debug speed metrics include bytes/frame --- app/phone-ui/main-view-model.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/phone-ui/main-view-model.ts b/app/phone-ui/main-view-model.ts index 15f12764..1644b01f 100644 --- a/app/phone-ui/main-view-model.ts +++ b/app/phone-ui/main-view-model.ts @@ -1188,9 +1188,12 @@ export class MainViewModel extends Observable { const oldest = this.bleRateHistory[0]!; const elapsedSec = (atMs - oldest.atMs) / 1000; if (elapsedSec > 0) { - const byteRate = (sample.bytes - oldest.bytes) / elapsedSec; - const frameRate = (sample.frames - oldest.frames) / elapsedSec; - label += ` · ${formatByteRate(byteRate)}, ${frameRate.toFixed(1)} fps`; + const byteDelta = sample.bytes - oldest.bytes; + const frameDelta = sample.frames - oldest.frames; + label += ` · ${formatByteRate(byteDelta / elapsedSec)}, ${(frameDelta / elapsedSec).toFixed(1)} fps`; + if (frameDelta > 0) { + label += `, ${formatCount(byteDelta / frameDelta)} B/frame`; + } } } catch (error) { label = `BLE sent: ${this.formatError(error)}`;