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

Function perMachineRange

telemetry-worker/src/rollup.ts:771–781  ·  view source on GitHub ↗

One day's statements, each over a sixteenth of the machines, a few to a round trip.

(
  lane: Lane,
  env: Env,
  day: string,
  statements: ReadonlyArray<{ sql: string; extra?: readonly string[] }>,
)

Source from the content-addressed store, hash-verified

769
770/** One day's statements, each over a sixteenth of the machines, a few to a round trip. */
771async function perMachineRange(
772 lane: Lane,
773 env: Env,
774 day: string,
775 statements: ReadonlyArray<{ sql: string; extra?: readonly string[] }>,
776): Promise<void> {
777 const bound = machineIdRanges(1).flatMap(([from, before]) =>
778 statements.map(({ sql, extra = [] }) => env.DB.prepare(sql).bind(day, from, before, ...extra)),
779 );
780 for (const group of chunked(bound, KEEP_BATCH)) await lane.batch(group);
781}
782
783/**
784 * Record, from one day's raw rows, the two things about a machine that are kept

Callers 2

keepWhatOutlivesFunction · 0.85
recordInstallProofFunction · 0.85

Calls 6

machineIdRangesFunction · 0.85
chunkedFunction · 0.85
mapMethod · 0.80
bindMethod · 0.80
prepareMethod · 0.65
batchMethod · 0.45

Tested by

no test coverage detected