IF Commons GitHub

physical/live

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0005-estate-query-live FR-002, 0005-estate-query-live FR-003

Asking the machines of a fleet at once, read only: for each machine and each table a question names, the SELECT made from the list of tables is sent through the way of reaching a machine that the host gives, a few at a time, each within a time, and what comes back is the relation of the table with the asset and the instant in front. A machine that does not answer is said in live_status and never read as a machine with no rows. A value that looks like a secret is replaced. Nothing here reaches a machine itself: the host gives the way.

import { gatherLive } from "./live.ts";
// const { tables, status } = await gatherLive({ assets: ["athens"], tables: ["processes"], fetch, now: () => new Date().toISOString() });

Source: commons/estate-query/src/physical/live.ts

1 of 8 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

physical.gatherLivefunctionno test imports it
function gatherLive(o: GatherOptions): Promise<Result<Gathered, string>>

The relations of the tables asked, from every machine, and the status of each machine and table.

physical.Fetchtypeno test imports it
type Fetch = (asset: string, select: string, signal: AbortSignal) => Promise<Result<readonly Readonly<Record<string, string>>[], string>>;

The way of reaching a machine: send the SELECT and give the rows as osquery prints them (every value as text), or why not.

physical.GatherOptionstypeno test imports it
type GatherOptions = { readonly assets: readonly string[]; /** The tables of osquery (without the prefix), each on t… (527 characters)
type GatherOptions = {
  readonly assets: readonly string[];
  /** The tables of osquery (without the prefix), each on the list. */
  readonly tables: readonly string[];
  readonly fetch: Fetch;
  readonly now: () => string;
  /** The most machines asked at once (4 by default). */
  readonly concurrency?: number;
  /** How long a machine has to answer, in milliseconds (15,000 by default). */
  readonly timeoutMs?: number;
  /** The most rows of a table from a machine (5,000 by default). */
  readonly rowLimit?: number;
};

What gatherLive is given.

physical.Gatheredtypeno test imports it
type Gathered = { readonly tables: Readonly<Record<string, Table>>; readonly status: Table };

What was gathered: the relations by name, and the status of each machine and table.

gatherLivefunction
function gatherLive(o: GatherOptions): Promise<Result<Gathered, string>>

The relations of the tables asked, from every machine, and the status of each machine and table.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

Fetchtypeno test imports it
type Fetch = (asset: string, select: string, signal: AbortSignal) => Promise<Result<readonly Readonly<Record<string, string>>[], string>>;

The way of reaching a machine: send the SELECT and give the rows as osquery prints them (every value as text), or why not.

GatherOptionstypeno test imports it
type GatherOptions = { readonly assets: readonly string[]; /** The tables of osquery (without the prefix), each on t… (527 characters)
type GatherOptions = {
  readonly assets: readonly string[];
  /** The tables of osquery (without the prefix), each on the list. */
  readonly tables: readonly string[];
  readonly fetch: Fetch;
  readonly now: () => string;
  /** The most machines asked at once (4 by default). */
  readonly concurrency?: number;
  /** How long a machine has to answer, in milliseconds (15,000 by default). */
  readonly timeoutMs?: number;
  /** The most rows of a table from a machine (5,000 by default). */
  readonly rowLimit?: number;
};

What gatherLive is given.

Gatheredtypeno test imports it
type Gathered = { readonly tables: Readonly<Record<string, Table>>; readonly status: Table };

What was gathered: the relations by name, and the status of each machine and table.

Titles, headings, exports, tables, columns and requirements. Esc closes.