* The stale-data warning. Silent when both writers are keeping up; otherwise says * which one stopped, since when, and what that leaves the page unable to show.
()
| 401 | * which one stopped, since when, and what that leaves the page unable to show. |
| 402 | */ |
| 403 | function drawDataWarning() { |
| 404 | const host = document.getElementById('data-warning'); |
| 405 | host.replaceChildren(); |
| 406 | const meta = state.meta; |
| 407 | const lines = []; |
| 408 | |
| 409 | if (meta?.ingest_stalled) { |
| 410 | lines.push([ |
| 411 | // The last day anything was stored, lifecycle event or usage counter. |
| 412 | `No new events since ${shortDay(meta.latest_ingest_day ?? meta.latest_raw_day)}.`, |
| 413 | ' The ingest worker at telemetry.getcodegraph.com is not storing anything; its logs and the D1 database are where to look.', |
| 414 | ]); |
| 415 | } |
| 416 | if (meta?.rollup_behind) { |
| 417 | lines.push([ |
| 418 | meta.latest_rollup_day |
| 419 | ? `The nightly rollup has not run since ${shortDay(meta.latest_rollup_day)}.` |
| 420 | : 'The nightly rollup has never run.', |
| 421 | ' Installs, indexing runs, tool calls and every breakdown stop there. Machine counts, new installs and retention are live.', |
| 422 | ]); |
| 423 | } |
| 424 | |
| 425 | for (const [lead, rest] of lines) { |
| 426 | const p = el('p'); |
| 427 | p.append(el('strong', null, lead), document.createTextNode(rest)); |
| 428 | host.append(p); |
| 429 | } |
| 430 | host.hidden = lines.length === 0; |
| 431 | } |
| 432 | |
| 433 | async function render() { |
| 434 | const token = ++state.renderToken; |
no test coverage detected