Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

/admin/data's Health section charts Pi temperature, with under-voltage minutes marked on the same axis #558

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

The Health section of `/admin/data` now has a Pi temperature chart, with under-voltage minutes marked on the same axis. I ran only the `src/data*` tests, which pass. I did not run the full `bun --cwd Software/so101 test` or the type check, because `tsc` couldn't load the `bun` types here. I also couldn't run `design-lint`, because `scripts/design-lint.ts` isn't in the repo.

shipped merged

opened this

The Health section of /admin/data now has a Pi temperature chart, with under-voltage minutes marked on the same axis. I ran only the src/data* tests, which pass. I did not run the full bun --cwd Software/so101 test or the type check, because tsc couldn't load the bun types here. I also couldn't run design-lint, because scripts/design-lint.ts isn't in the repo.

  • GET /data: series gains two fields, piTempC and undervoltMinutes, built from the Pi readings already stored with each minute sample. piTempC is the hottest reading in each step, or null when there was none. undervoltMinutes counts the samples flagged under-voltage in each step.
  • Chart: a new panel, "Health · Pi temperature, under-voltage minutes", sits in src/data-page.ts. The temperature is a line. Each step with under-voltage minutes gets a short block on the baseline. Hover, tap or the arrow keys show the exact °C and minute count.
  • Empty range: a range with no temperature and no under-voltage minutes draws no line or marks, only "No Pi temperature or under-voltage reading in this range". I did not add a test that checks that message itself. The series test covers the empty values, and the view test covers the chart with data and the absence of the message.
  • Code: the marks come from a small marks option I added to timeChart in src/ui/data-view.js.
  • Tests: data-series.test.ts covers the two new series. data-view.test.ts checks that the chart draws the mark and the tooltip shows both values.

Closes #546

1 earlier comment · 1 event
commented

The Health section of /admin/data now has a Pi temperature chart, with under-voltage minutes marked on the same axis. I ran only the src/data* tests, which pass. I did not run the full bun --cwd Software/so101 test or the type check, because tsc couldn't load the bun types here. I also couldn't run design-lint, because scripts/design-lint.ts isn't in the repo.

  • GET /data: series gains two fields, piTempC and undervoltMinutes, built from the Pi readings already stored with each minute sample. piTempC is the hottest reading in each step, or null when there was none. undervoltMinutes counts the samples flagged under-voltage in each step.
  • Chart: a new panel, "Health · Pi temperature, under-voltage minutes", sits in src/data-page.ts. The temperature is a line. Each step with under-voltage minutes gets a short block on the baseline. Hover, tap or the arrow keys show the exact °C and minute count.
  • Empty range: a range with no temperature and no under-voltage minutes draws no line or marks, only "No Pi temperature or under-voltage reading in this range". I did not add a test that checks that message itself. The series test covers the empty values, and the view test covers the chart with data and the absence of the message.
  • Code: the marks come from a small marks option I added to timeChart in src/ui/data-view.js.
  • Tests: data-series.test.ts covers the two new series. data-view.test.ts checks that the chart draws the mark and the tooltip shows both values.
Changes requested — before the latest push

The Pi chart is sound: the hottest-minute line, the baseline blocks and the tooltip all follow the data. It also needs no new door, since the tty reads GET /data and that server-side gate is unchanged. Two things are missing. Fix the first one first.

  1. README.md, 'The Data view' section, still lists Health as 'arm-link uptime; reconnects, app starts, STOPs, jams and blocks; camera fps'. Add 'Pi temperature with under-voltage minutes marked' there. Say that a block on the baseline is a step with under-voltage minutes. Say that the line is the hottest minute of each step. Also say how GET /data series now carries piTempC and undervoltMinutes, if the README lists series fields.
  2. The empty-state change in ui/data-view.js has no test that fails without it. Before this pull, a range with only under-voltage minutes would have shown 'Nothing in this range' and no marks. The new spec.series.concat(spec.marks||[]) check is what prevents that. In data-view.test.ts, add a case with an under-voltage sample but no temperature, and assert that no none text appears and one mark is drawn. Add a case with neither reading, and assert that the 'No Pi temperature or under-voltage reading' text appears. The added assertion on c-fps and its comment ('says so instead') check the opposite case and test nothing about this change, so remove or replace it.

I could not see the page in the preview: /admin/data answers 404 to an anonymous request, which is the intended gate.

commented

This pull makes the Health section of /admin/data chart Pi temperature, with under-voltage minutes marked on the same axis, and GET /data carries both series. The src/data* tests pass. I have not run the full suite or the type check, because tsc can't load the bun types here.

  • Chart: the line is the hottest Pi reading in each step. A block on the baseline marks a step that had under-voltage minutes. Hover or tap shows the exact °C and the minute count.
  • GET /data: series gains piTempC (the hottest reading per step, or null) and undervoltMinutes.
  • Empty range: with no temperature and no under-voltage minutes, no line or marks are drawn and the chart says "No Pi temperature or under-voltage reading in this range".
  • README (juniper's point 1): the Health bullet now lists the Pi chart and says what the line and the blocks mean. The series shape line names piTempC and undervoltMinutes.
  • Tests (juniper's point 2): I removed the c-fps assertion, which tested nothing about this change. In its place, data-view.test.ts has a case with an under-voltage sample and no temperature, which draws one mark and no "none" text. A second case with no readings shows the empty text and no marks. The first case fails if the spec.series.concat(spec.marks || []) empty-state check is reverted, which I confirmed by reverting it.
Approved

Does what the issue asked: GET /data gains piTempC and undervoltMinutes, and a Health panel charts the hottest Pi reading per step with under-voltage blocks on the baseline. It has a labelled note, tap and keyboard values, and an honest empty state. The series test and both view tests would fail without the change. Both are covered by the README. No new dependency. The preview answers 404 to a guest on /admin/data, so the page stays gated and I could not see the chart there. I read it from source and tests. Two things I would do next: (1) the under-voltage mark is a colour-only block, so give it a distinct pattern or outline for colour-blind readers; (2) run the full bun test and the type check in an environment that has the bun types, since the author could not.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs