MCPcopy Index your code
hub / github.com/nodejs/node / constructor

Method constructor

lib/diagnostics_channel.js:413–437  ·  view source on GitHub ↗
(nameOrChannels)

Source from the content-addressed store, hash-verified

411 #continuationWindow;
412
413 constructor(nameOrChannels) {
414 // Create a BoundedChannel for start/end (call window)
415 if (typeof nameOrChannels === 'string') {
416 this.#callWindow = new BoundedChannel(nameOrChannels);
417 this.#continuationWindow = new BoundedChannel({
418 start: channel(`tracing:${nameOrChannels}:asyncStart`),
419 end: channel(`tracing:${nameOrChannels}:asyncEnd`),
420 });
421 } else if (typeof nameOrChannels === 'object') {
422 this.#callWindow = new BoundedChannel({
423 start: nameOrChannels.start,
424 end: nameOrChannels.end,
425 });
426 this.#continuationWindow = new BoundedChannel({
427 start: nameOrChannels.asyncStart,
428 end: nameOrChannels.asyncEnd,
429 });
430 }
431
432 // Create individual channel for error
433 ObjectDefineProperty(this, 'error', {
434 __proto__: null,
435 value: channelFromMap(nameOrChannels, 'error', 'TracingChannel'),
436 });
437 }
438
439 get start() {
440 return this.#callWindow.start;

Callers

nothing calls this directly

Calls 2

channelFunction · 0.85
channelFromMapFunction · 0.85

Tested by

no test coverage detected