Performance

sealed external interface Performance(source)

Properties

Link copied to clipboard

eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). No other CPU idle time is taken into consideration.

Link copied to clipboard

This property is an extension by Node.js. It is not available in Web browsers.

Link copied to clipboard
abstract val timeOrigin: Double

The timeOrigin specifies the high resolution millisecond timestamp at which the current node process began, measured in Unix time.

Functions

Link copied to clipboard
abstract fun clearMarks(name: String = definedExternally)

If name is not provided, removes all PerformanceMark objects from the Performance Timeline. If name is provided, removes only the named mark.

Link copied to clipboard
abstract fun clearMeasures(name: String = definedExternally)

If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. If name is provided, removes only the named measure.

Link copied to clipboard
abstract fun clearResourceTimings(name: String = definedExternally)

If name is not provided, removes all PerformanceResourceTiming objects from the Resource Timeline. If name is provided, removes only the named resource.

Link copied to clipboard

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().

Link copied to clipboard
abstract fun getEntriesByName(name: String, type: EntryType = definedExternally): ReadonlyArray<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.

Link copied to clipboard

Returns a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime whose performanceEntry.entryType is equal to type.

Link copied to clipboard
abstract fun mark(name: String, options: MarkOptions = definedExternally): PerformanceMark

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.

Link copied to clipboard
abstract fun markResourceTiming(timingInfo: Any, requestedUrl: String, initiatorType: String, global: Any, cacheMode: PerformanceMarkResourceTimingCacheMode, bodyInfo: Any, responseStatus: Number, deliveryType: String = definedExternally): PerformanceResourceTiming

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.

Link copied to clipboard
abstract fun measure(name: String, options: MeasureOptions): PerformanceMeasure

abstract fun measure(name: String, startMark: String = definedExternally, endMark: String = definedExternally): PerformanceMeasure

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.

Link copied to clipboard
abstract fun now(): Double

Returns the current high resolution millisecond timestamp, where 0 represents the start of the current node process.

Link copied to clipboard
abstract fun setResourceTimingBufferSize(maxSize: Number)

Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects.

Link copied to clipboard
abstract fun <T : Function<Any?>> timerify(fn: T, options: TimerifyOptions = definedExternally): T

This property is an extension by Node.js. It is not available in Web browsers.

Link copied to clipboard
abstract fun toJSON(): Any?

An object which is JSON representation of the performance object. It is similar to window.performance.toJSON in browsers.