Documentation
    Preparing search index...

    Properties of the master program.

    Platform boundary: The servant path uses native filesystem spelling, and stdio exposes Node child-process modes without imposing separator or case policy.

    contracts/common.md#principled-implementation The fields are exactly what the master needs to plan a run: totals, parallelism, how to reach the servant program, and optional hooks; the count, threads, and simultaneous constraints are enforced by master, which the field prose states.

    contracts/common.md#clear-and-simple-design A flat property record; optional members carry the only extension points (filter, progress, memory, stdio).

    contracts/common.md#prohibited-implementation-shortcuts Every value is caller-supplied; no default names a target application or fixture.

    contracts/common.md#meaningful-documentation Each property documents its meaning and constraints, including how simultaneous is distributed among threads and that the filter receives a file basename.

    interface IMasterProps {
        count: number;
        filter?: (file: string) => boolean;
        memory?: () => Promise<MemoryUsage>;
        progress?: (complete: number) => void;
        servant: string;
        simultaneous: number;
        stdio?: "overlapped" | "pipe" | "ignore" | "inherit";
        threads: number;
    }
    Index
    count: number

    Total number of benchmark function invocations, each of which may log several HTTP requests.

    filter?: (file: string) => boolean

    Filter function.

    The filter function is called with the file name (basename) of each benchmark function module, not with the function name. When it returns false, the file would never be imported in the servant, so that every function defined in the file would never be executed either.

    Type Declaration

      • (file: string): boolean
      • Parameters

        • file: string

          File name (basename) of the benchmark functions

        Returns boolean

        Whether to execute the function or not.

    contracts/common.md#principled-implementation The predicate is asked for each candidate file name through the master driver before the servant imports it, so a rejected file's functions can never execute.

    contracts/common.md#clear-and-simple-design A single predicate on the file basename, with a default that accepts everything.

    contracts/common.md#prohibited-implementation-shortcuts Selection is by the caller's predicate, not by known file names.

    contracts/common.md#meaningful-documentation The comment states the argument (basename, not function name) and that a false result prevents the import.

    memory?: () => Promise<MemoryUsage>

    Get memory usage.

    Get the memory usage of the master program.

    Specify this property only when your backend server is running on a different process, so that need to measure the memory usage of the backend server from other process.

    The function is called once a second while the benchmark runs. If it rejects, the sampling stops and the report keeps the samples taken so far. A result still pending when execution ends is discarded when it settles.

    contracts/common.md#principled-implementation When the server under test runs in another process, the master's own process.memoryUsage() measures the wrong process, so the caller supplies a getter for the right one; it is sampled once a second while the run lasts.

    contracts/common.md#clear-and-simple-design One optional async getter that replaces the default sampler and nothing else.

    contracts/common.md#prohibited-implementation-shortcuts The default measures the master process itself; a caller getter is used as given, and a getter that rejects ends sampling rather than being retried or replaced.

    contracts/common.md#meaningful-documentation The comment states when to set it, the sampling cadence, and that a rejection stops the sampling and keeps earlier samples.

    progress?: (complete: number) => void

    Progress callback function.

    Progress counts completed benchmark function invocations, regardless of how many HTTP events each invocation logs.

    Type Declaration

      • (complete: number): void
      • Parameters

        • complete: number

          The number of completed benchmark function invocations.

        Returns void

    contracts/common.md#principled-implementation The callback receives the sum of completed invocation counts from every servant and is called once more with the requested count at the end, including when no matching functions were discovered.

    contracts/common.md#clear-and-simple-design One optional notification with a single number argument.

    contracts/common.md#prohibited-implementation-shortcuts The callback does not configure request counts or concurrency; a throw from the final callback propagates after servants have been closed rather than being hidden.

    contracts/common.md#meaningful-documentation The comment distinguishes completed benchmark function invocations from logged HTTP events.

    servant: string

    Path of the servant program.

    The path of the servant program executing the DynamicBenchmarker.servant function.

    simultaneous: number

    Number of simultaneous requests.

    The number of requests to be executed simultaneously.

    This property value is distributed among the threads servants like the count, so their budgets sum to it. It must not be less than the threads, as each servant runs at least one request at a time.

    stdio?: "overlapped" | "pipe" | "ignore" | "inherit"

    Standard I/O option.

    The standard I/O option for the servant programs.

    threads: number

    Number of threads.

    The number of threads to be executed as parallel servant.