Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions ShimmerCapture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,16 @@ Three things that take the sensor's link exclusively for a while. (The red LED
used to be here too; it is on **General** now, because nothing about it is a
test.)

**Link speed** free-runs the firmware's data-rate test for five seconds and
**Throughput** free-runs the firmware's data-rate test for five seconds and
counts what arrives, which is the only honest way to know a link's throughput:
BLE negotiates its connection interval with the host's own Bluetooth stack, so
two hosts and the same sensor can differ severalfold. It is Bluetooth-only —
the dock command set has no data-rate test — and refused while the sensor is
sensing or a transfer is running, because it saturates the link on purpose. The
figure lands in the SD card tab's stats and drives its download estimates, so
measuring once after connecting makes those estimates worth reading.
two hosts and the same sensor can differ severalfold. It is named for what it
measures rather than for a link, but on this sensor only the Bluetooth ones can
run it — the dock command set has no data-rate test at all. It is refused
while the sensor is sensing or a transfer is running, because it saturates the
link on purpose. The figure lands in the
SD card tab's stats and drives its download estimates, so measuring once after
connecting makes those estimates worth reading.

It used to sit beside the connect buttons. It is here now because it is a test
that holds the link, which is what everything else on this tab does, and it
Expand Down
16 changes: 8 additions & 8 deletions ShimmerCapture/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ <h1>Shimmer Capture</h1>
gating machinery with them. The connect row is where the eye
should land on the primary action. -->
<div class="card">
<div class="card-title">Link speed</div>
<div class="card-title">Throughput test</div>
<div class="field-hint" id="linkTestNote"></div>
<div class="row">
<button
Expand All @@ -973,7 +973,7 @@ <h1>Shimmer Capture</h1>
data-requires="idle"
data-cap="linkTest"
>
Measure link speed (5 s)
Measure throughput (5 s)
</button>
<span class="pill" id="linkSpeedPill">not measured</span>
</div>
Expand Down Expand Up @@ -1783,7 +1783,7 @@ <h1>Shimmer Capture</h1>
$("applyNote").textContent = plan.blocked;
} else if (linkTesting) {
$("applyNote").textContent =
"Waiting for the link-speed test to finish — it saturates the link on purpose, which is the whole point of it.";
"Waiting for the throughput test to finish — it saturates the link on purpose, which is the whole point of it.";
} else if (sdBusy) {
/* Not the firmware refusing this time — the page is. One link, one
conversation: a configuration write in the middle of a file
Expand Down Expand Up @@ -3654,7 +3654,7 @@ <h1>Shimmer Capture</h1>
three (see its setEnabled call), so leaving them unsaid greyed the
card out with no reason on screen. */
if (linkTesting) {
return "The link-speed test is running. It saturates the link on purpose — wait the few seconds for it to finish.";
return "The throughput test is running. It saturates the link on purpose — wait the few seconds for it to finish.";
}
if (brandBusy) {
return "A device-naming write is using the link. A download and a name write cannot share it — wait for it to finish.";
Expand Down Expand Up @@ -3856,7 +3856,7 @@ <h1>Shimmer Capture</h1>
return "The sensor is sensing, and the firmware refuses every configuration command while it is. Stop the stream before reading or writing calibration.";
}
if (linkTesting) {
return "The link-speed test is running. It saturates the link on purpose — wait the few seconds for it to finish.";
return "The throughput test is running. It saturates the link on purpose — wait the few seconds for it to finish.";
}
if (sdBusy) {
return "An SD card transfer is using the link. A calibration write and a download cannot share it — wait for the transfer to finish.";
Expand Down Expand Up @@ -3902,7 +3902,7 @@ <h1>Shimmer Capture</h1>
return "The sensor is sensing, and the firmware refuses a self-test while it is — the test takes the whole sensor over for up to a minute. Stop the stream first.";
}
if (linkTesting) {
return "The link-speed test is running. It saturates the link on purpose — wait the few seconds for it to finish.";
return "The throughput test is running. It saturates the link on purpose — wait the few seconds for it to finish.";
}
if (sdBusy) {
return "An SD card transfer is using the link. A report printed into the middle of a block stream would interleave with it — wait for the transfer to finish.";
Expand Down Expand Up @@ -3974,7 +3974,7 @@ <h1>Shimmer Capture</h1>
if (!client) return "disconnected";
if (testBusy) return "the self-test is running";
if (streaming || sdLogging) return "the sensor is sensing";
if (linkTesting) return "the link-speed test is running";
if (linkTesting) return "the throughput test is running";
if (sdBusy) return "an SD card transfer is using the link";
if (brandBusy) return "a device-naming write is using the link";
if (calibBusy) return "a calibration write is using the link";
Expand Down Expand Up @@ -4094,7 +4094,7 @@ <h1>Shimmer Capture</h1>
return "The sensor is sensing. New names only take effect when it restarts, and the firmware skips a restart while it is sensing so a recording can never be truncated — stop the stream before changing the names.";
}
if (linkTesting) {
return "The link-speed test is running. It saturates the link on purpose — wait the few seconds for it to finish.";
return "The throughput test is running. It saturates the link on purpose — wait the few seconds for it to finish.";
}
if (sdBusy) {
return "An SD card transfer is using the link. A name write and a download cannot share it — wait for the transfer to finish.";
Expand Down
18 changes: 9 additions & 9 deletions common/dev/verify.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ check(
linkOrder.ids.join(" → "),
);

// --- 4. the link-speed button's new home, before anything is connected ----
// --- 4. the throughput button's new home, before anything is connected ----
const linkIdle = await evaluate(`
const sdk = await import('/vendor/shimmer-web-sdk.esm.js');
const btn = document.getElementById('btnLinkTest');
Expand All @@ -234,7 +234,7 @@ check(
/* Twice moved: out of the SD panel, then out of the connect column. It is a
test that takes the link exclusively, which is what the Test tab is for,
and its result is still read by the SD panel's own estimates. */
"the link-speed button lives in the Test tab, not the SD panel or the connect column",
"the throughput button lives in the Test tab, not the SD panel or the connect column",
linkIdle.inTestTab &&
linkIdle.notInLinkCard &&
linkIdle.notInSdPanel &&
Expand Down Expand Up @@ -905,7 +905,7 @@ check(
`${sdDelete.before.length} → ${sdDelete.after.length} files, ${sdDelete.deleteCmds} SD_DELETE commands`,
);

// ---- the link-speed test
// ---- the throughput test
const sdLink = await evaluate(`
await window.sdBrowser.measureLinkSpeed(1200);
// The event log flushes on an animation frame, so the last lines are not
Expand All @@ -915,11 +915,11 @@ const sdLink = await evaluate(`
on: window.mockTransport.writes.some(w => w.bytes[0] === 0xA4 && w.bytes[1] === 1),
off: window.mockTransport.writes.some(w => w.bytes[0] === 0xA4 && w.bytes[1] === 0),
guide: [...document.querySelectorAll('#log .log-line')].map(l => l.textContent)
.filter(l => /raw link speed: |as a guide|currently on this card/.test(l)) };
.filter(l => /raw throughput: |as a guide|currently on this card/.test(l)) };
`);
const linkKBps = Number(/^([\d.]+) KB\/s$/.exec(sdLink.link)?.[1]);
check(
"the link-speed test runs the firmware data-rate test and reports a plausible rate",
"the throughput test runs the firmware data-rate test and reports a plausible rate",
sdLink.on &&
sdLink.off &&
linkKBps > 100 &&
Expand Down Expand Up @@ -951,7 +951,7 @@ const linkBtn = await evaluate(`
noteAfter: document.getElementById('linkTestNote').textContent };
`);
check(
"the link-speed button works from the Test tab and reports beside itself",
"the throughput button works from the Test tab and reports beside itself",
linkBtn.before.inTestTab &&
!linkBtn.before.disabled &&
linkBtn.before.note === "" &&
Expand All @@ -965,7 +965,7 @@ check(
"and while it runs it names itself as the thing holding the link",
linkBtn.during.disabled &&
/^(measuring…|[\d.]+ KB\/s …)$/.test(linkBtn.during.pill) &&
/link-speed test/.test(linkBtn.during.applyNote) &&
/throughput test/.test(linkBtn.during.applyNote) &&
/Measuring/.test(linkBtn.during.note),
`${linkBtn.during.pill} | ${linkBtn.during.applyNote}`,
);
Expand Down Expand Up @@ -1085,7 +1085,7 @@ check(
sdWhileStreaming.banner.slice(0, 80) + "…",
);
check(
"the link-speed test is refused while streaming, and says why rather than just greying",
"the throughput test is refused while streaming, and says why rather than just greying",
sdWhileStreaming.linkTestRoleGone &&
sdWhileStreaming.linkTest &&
/deliberately saturates the link/.test(sdWhileStreaming.linkTestNote) &&
Expand Down Expand Up @@ -4260,7 +4260,7 @@ const skip = await evaluate(`
`);
check(
"a sample is skipped, with the reason, while another panel holds the link",
/skipped/i.test(skip.status) && /link-speed/i.test(skip.status),
/skipped/i.test(skip.status) && /throughput/i.test(skip.status),
skip.status.slice(0, 90),
);
await send("Emulation.setTimezoneOverride", { timezoneId: "" });
Expand Down
8 changes: 4 additions & 4 deletions common/sd-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export function createSdBrowser(host, opts = {}) {
stat("capacity", "Card capacity"),
stat("files", "Files"),
stat("bytes", "Total size"),
stat("link", "Link speed"),
stat("link", "Link throughput"),
);

const setStat = (key, text) => {
Expand Down Expand Up @@ -994,7 +994,7 @@ export function createSdBrowser(host, opts = {}) {
}
setBusy(true);
log.log(
`measuring raw link speed (${(durationMs / 1000).toFixed(0)} s, firmware data-rate test)…`,
`measuring raw throughput (${(durationMs / 1000).toFixed(0)} s, firmware data-rate test)…`,
);
try {
const res = await client.runDataRateTest(durationMs, (bytes, ms) => {
Expand All @@ -1005,7 +1005,7 @@ export function createSdBrowser(host, opts = {}) {
setStat("link", `${res.kBps.toFixed(1)} KB/s`);
reportLinkSpeed(res.kBps, true);
log.log(
`raw link speed: ${res.kBps.toFixed(1)} KB/s ` +
`raw throughput: ${res.kBps.toFixed(1)} KB/s ` +
`(${fmtBytes(res.bytesReceived)} in ${(res.durationMs / 1000).toFixed(1)}s).`,
);
if (res.kBps > 0) {
Expand All @@ -1024,7 +1024,7 @@ export function createSdBrowser(host, opts = {}) {
}
return res;
} catch (err) {
log.error(`Link speed test failed: ${err?.message ?? err}`);
log.error(`Throughput test failed: ${err?.message ?? err}`);
reportLinkSpeed(null, true);
return null;
} finally {
Expand Down
Loading