diagnostics_channel.channel(name)
新增于: v15.1.0, v14.17.0
这是任何想要发布到命名通道的人的主要入口点。它生成一个通道对象,该对象经过优化以尽可能减少发布时的开销。
\This is the primary entry-point for anyone wanting to publish to a named channel. It produces a channel object which is optimized to reduce overhead at publish time as much as possible.
import diagnostics_channel from 'node:diagnostics_channel'; const channel = diagnostics_channel.channel('my-channel');const diagnostics_channel = require('node:diagnostics_channel'); const channel = diagnostics_channel.channel('my-channel');