An object that can be used to collect performance metrics from the current
Node.js instance. It is similar to window.performance in browsers.
performance.clearMarks
History
performance object as the receiver.performance.clearMarks(name?): void
stringIf name is not provided, removes all PerformanceMark objects from the
Performance Timeline. If name is provided, removes only the named mark.
performance.clearMeasures
History
performance object as the receiver.performance.clearMeasures(name?): void
stringIf name is not provided, removes all PerformanceMeasure objects from the
Performance Timeline. If name is provided, removes only the named measure.
performance.clearResourceTimings
History
performance object as the receiver.performance.clearResourceTimings(name?): void
stringIf name is not provided, removes all PerformanceResourceTiming objects from
the Resource Timeline. If name is provided, removes only the named resource.
performance.eventLoopUtilization
History
perf_hooks.eventLoopUtilization alias.performance.eventLoopUtilization(utilization1?, utilization2?): Object
This is an alias of perf_hooks.eventLoopUtilization().
This property is an extension by Node.js. It is not available in Web browsers.
performance.getEntries
History
performance object as the receiver.performance.getEntries(): PerformanceEntry[]
PerformanceEntry[]Returns a list of PerformanceEntry objects in chronological order with
respect to performanceEntry.startTime. If you are only interested in
performance entries of certain types or that have certain names, see
performance.getEntriesByType() and performance.getEntriesByName().
performance.getEntriesByName
History
performance object as the receiver.performance.getEntriesByName(name, type?): PerformanceEntry[]
Returns a list of PerformanceEntry objects in chronological order
with respect to performanceEntry.startTime whose performanceEntry.name is
equal to name, and optionally, whose performanceEntry.entryType is equal to
type.
performance.getEntriesByType
History
performance object as the receiver.performance.getEntriesByType(type): PerformanceEntry[]
stringPerformanceEntry[]Returns a list of PerformanceEntry objects in chronological order
with respect to performanceEntry.startTime whose performanceEntry.entryType
is equal to type.
performance.mark(name, options?): void
Creates a new PerformanceMark entry in the Performance Timeline. A
PerformanceMark is a subclass of PerformanceEntry whose
performanceEntry.entryType is always 'mark', and whose
performanceEntry.duration is always 0. Performance marks are used
to mark specific significant moments in the Performance Timeline.
The created PerformanceMark entry is put in the global Performance Timeline
and can be queried with performance.getEntries,
performance.getEntriesByName, and performance.getEntriesByType. When the
observation is performed, the entries should be cleared from the global
Performance Timeline manually with performance.clearMarks.
performance.markResourceTiming
History
performance.markResourceTiming(timingInfo, requestedUrl, initiatorType, global, cacheMode, bodyInfo, responseStatus, deliveryType?): void
ObjectstringstringObjectstringObjectnumberstring''.This property is an extension by Node.js. It is not available in Web browsers.
Creates a new PerformanceResourceTiming entry in the Resource Timeline. A
PerformanceResourceTiming is a subclass of PerformanceEntry whose
performanceEntry.entryType is always 'resource'. Performance resources
are used to mark moments in the Resource Timeline.
The created PerformanceMark entry is put in the global Resource Timeline
and can be queried with performance.getEntries,
performance.getEntriesByName, and performance.getEntriesByType. When the
observation is performed, the entries should be cleared from the global
Performance Timeline manually with performance.clearResourceTimings.
performance.measure(name, startMarkOrOptions?, endMark?): void
Creates a new PerformanceMeasure entry in the Performance Timeline. A
PerformanceMeasure is a subclass of PerformanceEntry whose
performanceEntry.entryType is always 'measure', and whose
performanceEntry.duration measures the number of milliseconds elapsed since
startMark and endMark.
The startMark argument may identify any existing PerformanceMark in the
Performance Timeline, or may identify any of the timestamp properties
provided by the PerformanceNodeTiming class. If the named startMark does
not exist, an error is thrown.
The optional endMark argument must identify any existing PerformanceMark
in the Performance Timeline or any of the timestamp properties provided by the
PerformanceNodeTiming class. endMark will be performance.now()
if no parameter is passed, otherwise if the named endMark does not exist, an
error will be thrown.
The created PerformanceMeasure entry is put in the global Performance Timeline
and can be queried with performance.getEntries,
performance.getEntriesByName, and performance.getEntriesByType. When the
observation is performed, the entries should be cleared from the global
Performance Timeline manually with performance.clearMeasures.
This property is an extension by Node.js. It is not available in Web browsers.
An instance of the PerformanceNodeTiming class that provides performance
metrics for specific Node.js operational milestones.
performance.now
History
performance object as the receiver.performance.now(): number
numberReturns the current high resolution millisecond timestamp, where 0 represents
the start of the current node process.
performance.setResourceTimingBufferSize
History
performance object as the receiver.performance.setResourceTimingBufferSize(maxSize): void
Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects.
By default the max buffer size is set to 250.
numberThe timeOrigin specifies the high resolution millisecond timestamp at
which the current node process began, measured in Unix time.
performance.timerify(fn, options?): void
FunctionObjectRecordableHistogramperf_hooks.createHistogram() that will record runtime durations in
nanoseconds.This is an alias of perf_hooks.timerify().
This property is an extension by Node.js. It is not available in Web browsers.
performance.toJSON
History
performance object as the receiver.performance.toJSON(): void
An object which is JSON representation of the performance object. It
is similar to window.performance.toJSON in browsers.
The 'resourcetimingbufferfull' event is fired when the global performance
resource timing buffer is full. Adjust resource timing buffer size with
performance.setResourceTimingBufferSize() or clear the buffer with
performance.clearResourceTimings() in the event listener to allow
more entries to be added to the performance timeline buffer.