Skip to content

Initial import of a Formula One (F1) telemetry demo#22

Open
mgoddard wants to merge 1 commit into
mainfrom
f1-telemetry-demo
Open

Initial import of a Formula One (F1) telemetry demo#22
mgoddard wants to merge 1 commit into
mainfrom
f1-telemetry-demo

Conversation

@mgoddard
Copy link
Copy Markdown
Contributor

This demo works via Docker, sets up a CedarDB instance and a couple of Go programs which simulate data for a F1 race and provide a GUI with dashboard views of how the race evolves along with a link to view the SQL queries being run to power the demo.

Copy link
Copy Markdown
Member

@lukasvogel lukasvogel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked out of the box for me!

Some minor nitpicks:

  • In lap 1 the speed heatmap seemed to be ahead of the race leader, I'm not sure why exactly.
  • Really love the SQL subpage. Nice way to show what's actually going on below the hood. The discriptions seem to mention some stuff about bugs that were fixed or limitations that don't apply anymore, though?

Comment thread f1-telemetry/schema.sql
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably drop this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed review, @lukasvogel ! I'll go over this on Thursday and make these changes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably drop this?

Comment on lines +275 to +276
<code>'drs_open'</code>, etc. — though only <code>race_start</code> is wired in today.
Good spot to hang future "what just happened" tickers off.</p>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that true? drs_open seems to be happening in the GUI?

Comment on lines +414 to +418
<p><em>Note:</em> the SSE feed's Best/Last fields aren't currently surfaced in the UI;
that's why this query still uses the original <code>ARRAY_AGG(... ORDER BY ...)[1]</code>
construct. If you ever wire those fields into the per-car panel, mirror the
<code>MAX(lap_number)</code> + self-join rewrite from §9 to stay portable across
Postgres-compatible engines that may not honor <code>ORDER BY</code> inside aggregates.</p>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably can drop this? Seems like an artifact of an earlier discussion with claude?

<div class="notes">
<p>Three CTEs plus a window function in a single round-trip. <code>lap_stats</code>
+ <code>last_lap</code> together replace the <code>(ARRAY_AGG(... ORDER BY lap_number DESC))[1]</code>
construct from §8 — the rewrite is more portable across engines that may not honor
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which rewrite? Do we need this?

ORDER BY bucket;</code></pre>
<div class="notes">
<p>The OLAP-flavoured one. Scans every telemetry row for the session — no
DISTINCT ON shortcut — and bins by 1%-of-lap <code>track_pos</code>. Returns up to
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the context of the DISTINCT ON shortcut mentioned?

Comment on lines +502 to +506
demo — pair it with §11 to show the simulator's writes keep ticking at full speed
regardless. <em>Portability fallback:</em> if your engine doesn't have
<code>WIDTH_BUCKET</code>, swap to
<code>LEAST(99, FLOOR(track_pos * 100)::int) + 1 AS bucket</code> — same semantics,
simpler arithmetic.</p>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also seems like an internal discussion artifact?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants