Skip to content

Latest commit

 

History

History

api

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

TraceEvents

constructor()

Call new TraceEvents() to create a new TraceEvents object to track the PerformanceEntry objects.

destroy()

Call traceEvents.destroy() when there is no more use of the TraceEvents object.

getEvents()

Call traceEvents.getEvents() to get the PerformanceEntry objects in the Trace Event Format:

[
  {
    "name": "B",
    "cat": "measure",
    "ph": "X",
    "pid": 1,
    "ts": 34509,
    "dur": 1004141,
    "args": null
  },
  {
    "name": "A",
    "cat": "measure",
    "ph": "X",
    "pid": 1,
    "ts": 33837,
    "dur": 2002098,
    "args": { "foo": "bar" }
  }
]

trackRequires(switch, options) (only available in CommonJS)

  • switch (bool) - Call trackRequires(true) to enable tracking require()s and call trackRequires(false) to disable tracking require()s.
  • options (object)
    • trackSource (bool) - Call trackRequires(true, { trackSource: true }) to enable tracking require()s and also capture the source locations. This creates a throw-away error object and parses the stack property, so it introduces an overhead.