阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js trace_events.getEnabledCategories

      Node.js trace_events.getEnabledCategories

      新增于: v10.0.0

      • Returns: < string>

      Returns a comma-separated list of all currently-enabled trace event categories. The current set of enabled trace event categories is determined by the union of all currently-enabled Tracing objects and any categories enabled using the –trace-event-categories flag.

      Given the file test.js below, the command node –trace-event-categories node.perf test.js will print ‘node.async_hooks,node.perf’ to the console.

      const trace_events = require('trace_events');
      const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] });
      const t2 = trace_events.createTracing({ categories: ['node.perf'] });
      const t3 = trace_events.createTracing({ categories: ['v8'] });
      
      t1.enable();
      t2.enable();
      
      console.log(trace_events.getEnabledCategories());
      

      更多内容请参考:Node.js trace_events 跟踪事件,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录