MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / drawDataWarning

Function drawDataWarning

telemetry-dashboard/public/app.js:403–431  ·  view source on GitHub ↗

* 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.

()

Source from the content-addressed store, hash-verified

401 * which one stopped, since when, and what that leaves the page unable to show.
402 */
403function 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
433async function render() {
434 const token = ++state.renderToken;

Callers 1

refreshMetaFunction · 0.85

Calls 3

shortDayFunction · 0.90
elFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected