@@ -316,6 +316,9 @@ added: REPLACEME
316316* ` name ` {string} The benchmark name. ** Default:** The ` name ` property of ` fn ` ,
317317 or ` '<anonymous>' ` when ` fn ` has no name.
318318* ` options ` {Object}
319+ * ` diagnosticChannels ` {Array} String diagnostics channel names, deduplicated
320+ and inherited from containing suites by union. Symbol values in the array
321+ are silently ignored. ** Default:** ` [] ` .
319322 * ` only ` {boolean} When any benchmark or containing suite has ` only ` set,
320323 benchmarks without ` only ` in their hierarchy are skipped. ** Default:**
321324 ` false ` .
@@ -346,6 +349,12 @@ samples, but their samples are discarded. An exception, rejection, timeout,
346349abort, missing timing call, or duplicate timing call stops the current
347350benchmark. Later benchmarks continue to run.
348351
352+ For each warmup and measured callback, the runner subscribes to the configured
353+ diagnostics channels. Each publication queues a context diagnostic whose
354+ ` message ` is ` { name, message } ` , containing the string channel name and the
355+ published message. Subscriptions are removed when the callback settles or is
356+ aborted.
357+
349358A timeout or abort cannot interrupt synchronous JavaScript and does not forcibly
350359cancel asynchronous work that ignores ` context.signal ` .
351360
@@ -388,6 +397,9 @@ added: REPLACEME
388397* ` name ` {string} The suite name. ** Default:** The ` name ` property of ` fn ` , or
389398 ` '<anonymous>' ` when ` fn ` has no name.
390399* ` options ` {Object}
400+ * ` diagnosticChannels ` {Array} String diagnostics channel names inherited by
401+ nested suites and benchmarks. Symbol values in the array are silently
402+ ignored. ** Default:** ` [] ` .
391403 * ` only ` {boolean} Selects all benchmarks nested in this suite. ** Default:**
392404 ` false ` .
393405 * ` skip ` {boolean|string} Skips all benchmarks nested in this suite.
@@ -504,7 +516,7 @@ for await (const { type, data } of run()) {
504516added: REPLACEME
505517-->
506518
507- * ` path ` {string} The absolute path of one benchmark module.
519+ * ` path ` {string|Buffer|URL } The path of one benchmark module.
508520* ` options ` {Object}
509521 * ` env ` {Object} The child process environment. Property values must be
510522 strings or ` undefined ` . This replaces, rather than extends, the parent
@@ -518,18 +530,22 @@ added: REPLACEME
518530* Returns: {BenchmarksStream}
519531
520532Runs exactly one benchmark module in a fresh child process and returns its
521- object-mode event stream. ` path ` is not interpreted as a glob. Unless the signal
522- is aborted or the stream is destroyed before startup, every call uses a new
523- child. Input discovery, ordering, concurrency, retries, and multi-file
524- scheduling remain the caller's responsibility.
533+ object-mode event stream. A relative ` path ` is resolved from the current working
534+ directory when ` runFile() ` is called. ` path ` is not interpreted as a glob.
535+ Unless the signal is aborted or the stream is destroyed before startup, every
536+ call uses a new child. Input discovery, ordering, concurrency, retries, and
537+ multi-file scheduling remain the caller's responsibility.
538+
539+ When the Permission Model is enabled, the caller must have file system read
540+ access to ` path ` and permission to create child processes.
525541
526542Records use advanced child process serialization, preserving supported
527543structured values such as ` bigint ` and errors. Child writes to stdout and stderr
528- become ` 'bench:diagnostic' ` records. A module loading error, abnormal child exit ,
529- or cancellation also emits an error diagnostic and produces a terminal
530- ` 'bench:summary' ` whose ` success ` property is ` false ` ; these execution failures
531- do not error the stream. If module evaluation fails after declaring benchmarks,
532- those declarations still run before the unsuccessful summary.
544+ become ` 'bench:diagnostic' ` records. A permission failure, module loading error ,
545+ abnormal child exit, or cancellation also emits an error diagnostic and produces
546+ a terminal ` 'bench:summary' ` whose ` success ` property is ` false ` ; these execution
547+ failures do not error the stream. If module evaluation fails after declaring
548+ benchmarks, those declarations still run before the unsuccessful summary.
533549
534550` env ` , effective inherited options, and an explicitly provided ` execArgv ` are
535551copied when ` runFile() ` is called. The runner removes ` NODE_OPTIONS ` , replaces
@@ -659,7 +675,8 @@ message transport from the duration. `record()` is mutually exclusive with
659675added: REPLACEME
660676-->
661677
662- * ` message ` {string} The diagnostic message.
678+ * ` message ` {any} A structured-cloneable diagnostic value. With CLI process
679+ isolation, it must also be supported by advanced child process serialization.
663680* ` options ` {Object}
664681 * ` level ` {string} Either ` 'info' ` or ` 'warning' ` . ** Default:** ` 'info' ` .
665682 * ` detail ` {any} Additional structured-cloneable diagnostic data. With CLI
@@ -675,10 +692,10 @@ before a callback failure are emitted before the failed `'bench:complete'`
675692event and do not themselves cause the benchmark to fail. If a timeout or abort
676693wins before the callback settles, queued diagnostics might not be emitted.
677694
678- The message and options are validated, and detail is cloned, synchronously.
679- Calling ` diagnostic() ` between ` context.start() ` and ` context.end() ` therefore
680- includes that work in the measured duration. Invalid arguments or an
681- uncloneable detail violate the sample contract.
695+ The message and detail are cloned synchronously. Options are also validated
696+ synchronously. Calling ` diagnostic() ` between ` context.start() ` and
697+ ` context.end() ` therefore includes that work in the measured duration. Invalid
698+ arguments or an uncloneable message or detail violate the sample contract.
682699
683700### ` context.done() `
684701
@@ -747,6 +764,8 @@ isolation, all files share one runner and their plans are emitted before any
747764benchmark executes. Plan data contains the benchmark-scoped identity, location,
748765tags, and parameters described in [ benchmark result] [ ] , together with:
749766
767+ * ` diagnosticChannels ` {string\[ ] } The inherited string channel names
768+ subscribed to during each callback.
750769* ` samples ` {number} The effective maximum number of measured callback
751770 invocations after run-level overrides.
752771* ` warmup ` {number} The effective number of unreported warmup callback
0 commit comments