PerformanceResourceTiming

The PerformanceResourceTiming interface enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources. An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource, such as an XMLHttpRequest, , image, or script.

MDN Reference

Properties

Link copied to clipboard

The connectEnd read-only property returns the timestamp immediately after the browser finishes establishing the connection to the server to retrieve the resource. The timestamp value includes the time interval to establish the transport connection, as well as other time intervals such as TLS handshake and SOCKS authentication.

Link copied to clipboard

The connectStart read-only property returns the timestamp immediately before the user agent starts establishing the connection to the server to retrieve the resource.

Link copied to clipboard

The decodedBodySize read-only property returns the size (in octets) received from the fetch (HTTP or cache) of the message body after removing any applied content encoding (like gzip or Brotli). If the resource is retrieved from an application cache or local resources, it returns the size of the payload after removing any applied content encoding.

Link copied to clipboard

The domainLookupEnd read-only property returns the timestamp immediately after the browser finishes the domain-name lookup for the resource.

Link copied to clipboard

The domainLookupStart read-only property returns the timestamp immediately before the browser starts the domain name lookup for the resource.

Link copied to clipboard

The read-only duration property returns a timestamp that is the duration of the performance entry. The meaning of this property depends on the value of this entry's entryType.

Link copied to clipboard

The encodedBodySize read-only property represents the size (in octets) received from the fetch (HTTP or cache) of the payload body before removing any applied content encodings (like gzip or Brotli). If the resource is retrieved from an application cache or a local resource, it must return the size of the payload body before removing any applied content encoding.

Link copied to clipboard

The read-only entryType property returns a string representing the type of performance metric that this entry represents.

Link copied to clipboard

The fetchStart read-only property represents a timestamp immediately before the browser starts to fetch the resource.

Link copied to clipboard

The initiatorType read-only property is a string representing web platform feature that initiated the resource load.

Link copied to clipboard

The read-only name property of the PerformanceEntry interface is a string representing the name for a performance entry. It acts as an identifier, but it does not have to be unique. The value depends on the subclass.

Link copied to clipboard

The nextHopProtocol read-only property is a string representing the network protocol used to fetch the resource, as identified by the ALPN Protocol ID (RFC7301).

Link copied to clipboard

The redirectEnd read-only property returns a timestamp immediately after receiving the last byte of the response of the last redirect.

Link copied to clipboard

The redirectStart read-only property returns a timestamp representing the start time of the fetch which that initiates the redirect.

Link copied to clipboard

The requestStart read-only property returns a timestamp of the time immediately before the browser starts requesting the resource from the server, cache, or local resource. If the transport connection fails and the browser retires the request, the value returned will be the start of the retry request.

Link copied to clipboard

The responseEnd read-only property returns a timestamp immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first.

Link copied to clipboard

The responseStart read-only property returns a timestamp immediately after the browser receives the first byte of the response from the server, cache, or local resource.

Link copied to clipboard

The responseStatus read-only property represents the HTTP response status code returned when fetching the resource.

Link copied to clipboard

The secureConnectionStart read-only property returns a timestamp immediately before the browser starts the handshake process to secure the current connection. If a secure connection is not used, the property returns zero.

Link copied to clipboard

The serverTiming read-only property returns an array of PerformanceServerTiming entries containing server timing metrics.

Link copied to clipboard

The read-only startTime property returns the first timestamp recorded for this PerformanceEntry. The meaning of this property depends on the value of this entry's entryType.

Link copied to clipboard

The transferSize read-only property represents the size (in octets) of the fetched resource. The size includes the response header fields plus the response payload body (as defined by RFC7230).

Link copied to clipboard

The workerStart read-only property of the PerformanceResourceTiming interface returns a DOMHighResTimeStamp immediately before dispatching the FetchEvent if a Service Worker thread is already running, or immediately before starting the Service Worker thread if it is not already running. If the resource is not intercepted by a Service Worker the property will always return 0.

Functions

Link copied to clipboard
open override fun toJSON(): JsAny

The toJSON() method of the PerformanceResourceTiming interface is a serializer; it returns a JSON representation of the PerformanceResourceTiming object.