PerformanceResourceTiming

PerformanceResourceTiming インターフェイスは、アプリケーションのリソースのロードに関する詳細なネットワークタイミングデータの取得と分析を可能にします。アプリケーションはタイミングメトリックを使用して、たとえば、XMLHttpRequest<SVG>、画像、スクリプトなどの特定のリソースを取得するのにかかる時間を判断できます。

インターフェイスのプロパティは、リダイレクトの開始時刻と終了時刻、フェッチの開始時刻、DNS ルックアップの開始時刻と終了時刻、レスポンスの開始時刻と終了時刻などのネットワークイベントに対するハイレゾリューションタイムスタンプを含むリソースロードタイムラインを作成します。さらに、このインターフェイスは、取得したリソースのサイズや取得を開始したリソースの種類に関するデータを提供する他のプロパティを使用して PerformanceEntry を拡張します。

注:

この機能は Web Worker 内で利用可能です。

プロパティ

このインターフェイスは、以下のように修飾し制約することによって、リソースパフォーマンスエントリタイプの PerformanceEntry プロパティを拡張します。

PerformanceEntry.entryType読取専用
"resource" を返します。
PerformanceEntry.name読取専用
Returns the resources URL.
PerformanceEntry.startTime読取専用
Returns the timestamp for the time a resource fetch started. This value is equivalent to PerformanceEntry.fetchStart.
PerformanceEntry.duration読取専用
Returns a timestamp that is the difference between the responseEnd and the startTime properties.

The interface also supports the following properties which are listed in the order in which they are recorded for the fetching of a single resource. An alphabetical listing is shown in the navigation, at left.

PerformanceResourceTiming.initiatorType読取専用
A string representing the type of resource that initiated the performance entry, as specified in PerformanceResourceTiming.initiatorType.
PerformanceResourceTiming.nextHopProtocol読取専用
A string representing the network protocol used to fetch the resource, as identified by the ALPN Protocol ID (RFC7301).
PerformanceResourceTiming.workerStart読取専用
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.
PerformanceResourceTiming.redirectStart読取専用
A DOMHighResTimeStamp that represents the start time of the fetch which initiates the redirect.
PerformanceResourceTiming.redirectEnd読取専用
A DOMHighResTimeStamp immediately after receiving the last byte of the response of the last redirect.
PerformanceResourceTiming.fetchStart読取専用
A DOMHighResTimeStamp immediately before the browser starts to fetch the resource.
PerformanceResourceTiming.domainLookupStart読取専用
A DOMHighResTimeStamp immediately before the browser starts the domain name lookup for the resource.
PerformanceResourceTiming.domainLookupEnd読取専用
A DOMHighResTimeStamp representing the time immediately after the browser finishes the domain name lookup for the resource.
PerformanceResourceTiming.connectStart読取専用
A DOMHighResTimeStamp immediately before the browser starts to establish the connection to the server to retrieve the resource.
PerformanceResourceTiming.connectEnd読取専用
A DOMHighResTimeStamp immediately after the browser finishes establishing the connection to the server to retrieve the resource.
PerformanceResourceTiming.secureConnectionStart読取専用
A DOMHighResTimeStamp immediately before the browser starts the handshake process to secure the current connection.
PerformanceResourceTiming.requestStart読取専用
A DOMHighResTimeStamp immediately before the browser starts requesting the resource from the server.
PerformanceResourceTiming.responseStart読取専用
A DOMHighResTimeStamp immediately after the browser receives the first byte of the response from the server.
PerformanceResourceTiming.responseEnd読取専用
A DOMHighResTimeStamp immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first.
PerformanceResourceTiming.transferSize読取専用
A number representing the size (in octets) of the fetched resource. The size includes the response header fields plus the response payload body.
PerformanceResourceTiming.encodedBodySize読取専用
A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before removing any applied content-codings.
PerformanceResourceTiming.decodedBodySize読取専用
A number that is the size (in octets) received from the fetch (HTTP or cache) of the message body, after removing any applied content-codings.
PerformanceResourceTiming.serverTiming読取専用
An array of PerformanceServerTiming entries containing server timing metrics.

メソッド

PerformanceResourceTiming.toJSON()
Returns a DOMString that is the JSON representation of the PerformanceResourceTiming object.

リソースタイミング API の使用の例を参照してください。

仕様

仕様書 ステータス コメント
Resource Timing Level 1
PerformanceResourceTiming の定義
勧告候補 初期定義

ブラウザの互換性

BCD tables only load in the browser

あわせて参照