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 toPerformanceEntry.fetchStart
. PerformanceEntry.duration
読取専用- Returns a
timestamp
that is the difference between theresponseEnd
and thestartTime
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 inPerformanceResourceTiming.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 theFetchEvent
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 thePerformanceResourceTiming
object.
例
リソースタイミング API の使用の例を参照してください。
仕様
仕様書 | ステータス | コメント |
---|---|---|
Resource Timing Level 1 PerformanceResourceTiming の定義 |
勧告候補 | 初期定義 |
ブラウザの互換性
BCD tables only load in the browser