From c3d97c8c7957008d153fec5145a9c1400f2094e7 Mon Sep 17 00:00:00 2001 From: Ilya Grigorik Date: Fri, 20 Feb 2015 09:37:58 -0800 Subject: [PATCH] removing definition of Performance interface - definition is now in Performance Timeline [1] - consistent abstract with resource timing - update diff from NT1 in Status section - simplified introduction to remove comparison to NT1 [1] https://github.com/w3c/performance-timeline/pull/7 --- index.html | 169 ++++++++++------------------------------------------- 1 file changed, 30 insertions(+), 139 deletions(-) diff --git a/index.html b/index.html index 0dcfaf5..4d67112 100644 --- a/index.html +++ b/index.html @@ -72,28 +72,25 @@
- -

This specification defines a unified interface to store and retrieve high resolution performance metric data -related to the navigation of a document.

+

This specification defines an interface for web applications to access the complete timing information for navigation of a document.

-

This is a work in progress and may change without any notices.

- Navigation Timing 2 replaces the first version of Navigation Timing [[Navigation-Timing]] + Navigation Timing 2 replaces the first version of [[NAVIGATION-TIMING]] and includes the following changes:

@@ -108,18 +105,8 @@

Introduction

-

-Accurately measuring performance characteristics of web applications is an important -aspect of making web applications faster. -While JavaScript-based mechanisms, such as the one described in -[[JSMEASURE]], can -provide comprehensive instrumentation for -user latency measurements within an application, in many cases, they are -unable to provide a complete or detailed end-to-end latency picture. -

+

Accurately measuring performance characteristics of web applications is an important aspect of making web applications faster. While JavaScript-based mechanisms, such as the one described in [[JSMEASURE]], can provide comprehensive instrumentation for user latency measurements within an application, in many cases, they are unable to provide a complete or detailed end-to-end latency picture. For example, the following JavaScript shows a naive attempt to measure the time it takes to fully load a page:

-

For example, the following JavaScript shows a naive attempt to -measure the time it takes to fully load a page:

<html>
 <head>
 <script type="text/javascript">
@@ -136,57 +123,16 @@ 

Introduction

</body> </html>
-

The script calculates the time it takes to load the page after the -first bit of JavaScript in the head is executed, but it does not give any -information about the time it takes to get the page from the server.

- -

To address the need for complete and detailed information on the navigation of the -document, the Navigation Timing -specification [[Navigation-Timing]] defines the PerformanceTiming -interface. This interface allows JavaScript mechanisms to provide complete client-side latency -measurements within applications.

- -

-However, the PerformanceTiming -interface was not defined to provide data in sub-millisecond resolution, which can be useful for analysis purposes. -Further, the PerformanceTiming interface -does not participate in the -Performance Timeline [[Performance-Timeline]], a unifying -interface to access and retrieve performance metrics from the performance timeline of a web application. -

- -

-Additionally, the PerformanceTiming -interface measures the time of its attributes from January 01 1970, leading to very large numbers representing the time values. -

- -

For example, if we know that the response end occurs 100ms after the start of navigation, we MAY find data that the -the PerformanceTiming data looks like so: -

-
-navigationStart:   1314223489190
-responseEnd:       1314223489290
-
+

The above script calculates the time it takes to load the page after the first bit of JavaScript in the head is executed, but it does not give any information about the time it takes to get the page from the server, or the initialization lifecycle of the page.

-

-This specification defines the PerformanceNavigationTiming interface which participates -in the Performance Timeline -to store and retrieve high resolution performance metric data related to the navigation of a document. -As the PerformanceNavigationTiming interface uses -High Resolution Time [[HR-Time]], all time values are measured from the start -of the navigation. -

+

This specification defines the PerformanceNavigationTiming interface which participates in the [[PERFORMANCE-TIMELINE]] to store and retrieve high resolution performance metric data related to the navigation of a document. As the PerformanceNavigationTiming interface uses [[HR-TIME]], all time values are measured from the start of the navigation. For example, if we know that the response end occurs 100ms after the start of navigation, we MAY find data that the PerformanceNavigationTiming data looks like so:

-

For example, if we know that the response end occurs 100ms after the start of navigation, we MAY find data that the PerformanceNavigationTiming data looks like so: -

-startTime:           0.000
-responseEnd:       100.000
+startTime:           0.000  // start time of the navigation request
+responseEnd:       100.000  // high resolution time of last received byte
 
-

The following script shows how a developer can use the PerformanceNavigationTiming interface -to obtain accurate timing data related to the navigation of the document. -

+

The following script shows how a developer can use the PerformanceNavigationTiming interface to obtain accurate timing data related to the navigation of the document:

 <!doctype html>
@@ -198,7 +144,7 @@ 

Introduction

function init() { var navigationTiming = performance.getEntriesByType("navigation")[0]; if (window.console) { - console.log("Name: " + navigationTiming.name + "\n" + + console.log("Name: " + navigationTiming.name + "\n" + "Entry Type: " + navigationTiming.entryType + "\n" + "Start Time: " + navigationTiming.startTime + "\n" + "Duration: " + navigationTiming.duration + "\n" + @@ -226,7 +172,6 @@

Introduction

</body> </html>
-
@@ -252,90 +197,36 @@

Introduction

Terminology

+

The construction "a Foo object", where Foo is actually an interface, is sometimes used instead of the more accurate "an object implementing the interface Foo.

-

The construction "a Foo object", where Foo is actually an interface, is sometimes used instead of the more accurate "an object implementing the interface Foo".

+

The term "navigation" refers to the act of navigating.

-

The term "navigation" refers to the act of -navigating.

+

The term "JavaScript" is used to refer to ECMA262, rather than the +official term ECMAScript, since the term JavaScript is more widely known. [[ECMA-262]]

-

The term "JavaScript" is used to refer to ECMA262, rather than the -official term ECMAScript, since the term JavaScript is more widely known. [[ECMA-262]] -

-

- Throughout this work, all time values are measured in milliseconds since the start of - navigation of the document. For example, the start of navigation of the document - occurs at time 0. The term current time refers to the number of milliseconds - since the start of navigation of the document until the current moment in time. - This definition of time is based on the High Resolution Time specification - [[high-resolution-time] and is different - from the definition of time used in the Navigation Timing specification - [[Navigation-Timing]], - where time is measured in milliseconds since midnight of January 1, 1970 (UTC). -

+

Throughout this work, all time values are measured in milliseconds since the start of navigation of the document. For example, the start of navigation of the document occurs at time 0. The term current time refers to the number of milliseconds since the start of navigation of the document until the current moment in time. This definition of time is based on [[HR-TIME]] specification.

Navigation Timing

-
-

Introduction

- -

- This specification defines the Performance interface - to host performance related attributes and methods, and the - PerformanceNavigationTiming interface - to store and retrieve high resolution performance metric data related to the navigation of a document. -

-
+
+

The PerformanceNavigationTiming interface

-
-

The Performance interface

+

The PerformanceNavigationTiming interface participates in the [[!PERFORMANCE-TIMELINE]] and extends the following attributes of the PerformanceEntry interface:

-

-The Performance interface hosts performance related attributes and methods. -

+
+
name
+
This attribute MUST return the DOMString "document".
-
-
+
entryType
+
This attribute MUST return the DOMString "navigation".
-
-
[Replaceable] readonly attribute Performance performance
-
-

This attribute allows access to performance related attributes and methods.

-
-
- -
+
startTime
+
This attribute MUST return a DOMHighResTimeStamp with a time value of 0. [[!HR-TIME]]
-
-

The PerformanceNavigationTiming interface

-

-The PerformanceNavigationTiming interface participates in the - Performance Timeline [[!Performance-Timeline]] and extends the following attributes of the - PerformanceEntry interface: -

- -
-
name
-
-This attribute MUST return the DOMString "document". -
-
entryType
-
-This attribute MUST return the DOMString "navigation". -
-
startTime
-
-This attribute MUST return a DOMHighResTimeStamp - with a time value of 0. [[!HR-Time]] -
-
duration
-
-This attribute MUST return a DOMHighResTimeStamp - equal to the difference between loadEventEnd and startTime, respectively. -
+
duration
+
This attribute MUST return a DOMHighResTimeStamp equal to the difference between loadEventEnd and startTime, respectively.