Files
gods-eye-view/src/sources/phaseTiming.js
T
manjunath 2e82425d62 address review findings on voice outlines
- remove the unused Nominatim reserve(); spacing tests now measure the
  actual transport start across processes
- start each queued building's 2 s ground-sampling budget when it
  reaches the head of the queue, and request a frame on promotion
- accept Nominatim and grounds outlines that cross the antimeridian
- let an unnamed school, university, hospital, cemetery, stadium or zoo
  area answer a grounds ask whose head noun names that kind, using only
  the part that holds the point; compare grounds names symmetrically
- charge shared OpenFreeMap consumers their own slice and keep the
  charged budget at the previous 64 MiB
- share one place-name fold, point-in-polygon, line stitching and
  nextTask helper instead of duplicates
- exclude Who's On First sources licensed only as "CC BY (equivalent)"
  or "CC0 (equivalent)"; rebuild the pack from the pinned archives
- whole-word neighbourhood alias guard; correct the outline size-limit
  comment
- restore DATA_SOURCES.md table formatting, keeping only real edits
- test behaviour instead of private engine fields
2026-10-30 20:47:20 +05:30

54 lines
1.3 KiB
JavaScript

/** Optional development phase measurements; no provider payloads or credentials. */
export function phaseTiming(phase, start, detail = {}, scope = 'roads') {
if (import.meta.env?.DEV)
performance.measure(`${scope}:${phase}`, {
start,
end: performance.now(),
detail,
});
}
/** Bounded development evidence for one physical outline installation. */
export function createWorkTrace() {
if (!import.meta.env?.DEV) return null;
try {
return {
timeOrigin: performance.timeOrigin,
slices: [],
dropped: 0,
probes: 0,
samplerStart: null,
samplerHeadAt: null,
samplerStatus: null,
rendererStatus: null,
status: 'pending',
completedAt: null,
};
} catch {
return null;
}
}
/** Never let optional diagnostic recording change an installation outcome. */
export function recordWorkSlice(trace, phase, start, end, detail) {
if (!trace) return;
try {
if (trace.slices.length >= 16) {
trace.dropped += 1;
return;
}
trace.slices.push({
phase,
start,
end: end ?? performance.now(),
...(detail === undefined ? {} : { detail }),
});
} catch {
try {
trace.dropped += 1;
} catch {
// Missing or incomplete evidence fails the measurement, not the product.
}
}
}