You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: files/en-us/web/api/console/timestamp_static/index.md
+75-1Lines changed: 75 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,21 +14,94 @@ The **`console.timeStamp()`** static method adds a single marker to the browser'
14
14
15
15
You can optionally supply an argument to label the timestamp, and this label will then be shown alongside the marker.
16
16
17
+
Some browsers have further extended this `console.timeStamp()` method to allow additional, optional parameters to be provided as part of its extensibility API that surfaces these in performances traces. See the [Chrome's extensibility API documentation](https://developer.chrome.com/docs/devtools/performance/extension#inject_your_data_with_consoletimestamp) for more information.
- : A string for the display colour of the entry. Must be one of `"primary"`, `"primary-light"`, `"primary-dark"`, `"secondary"`, `"secondary-light"`, `"secondary-dark"`, `"tertiary"`, `"tertiary-light"`, `"tertiary-dark"`, `"error"`.
-[Adding markers with the console API](https://web.archive.org/web/20211207010020/https://firefox-source-docs.mozilla.org/devtools-user/performance/waterfall/index.html#adding-markers-with-the-console-api)
Copy file name to clipboardExpand all lines: files/en-us/web/api/performance/mark/index.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,10 +21,22 @@ mark(name, markOptions)
21
21
22
22
-`name`
23
23
- : A string representing the name of the mark. Must not be the same name as one of the properties of the deprecated {{domxref("PerformanceTiming")}} interface.
24
+
24
25
-`markOptions` {{optional_inline}}
25
26
- : An object for specifying a timestamp and additional metadata for the mark.
26
27
-`detail` {{optional_inline}}
27
28
- : Arbitrary metadata to include in the mark. Defaults to `null`. Must be [structured-cloneable](/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm).
- : Some browsers have use a structured `devtools` object within the `detail` object as part of an Extensibility API that surfaces these in custom tracks in performance traces. See the [Chrome's Extensibility API documentation](https://developer.chrome.com/docs/devtools/performance/extension#inject_your_data_with_the_user_timings_api) for more information.
31
+
-`dataType` {{experimental_inline}}
32
+
- : A string which must be set to `marker`. Identifies as a marker.
- : Defaults to `"primary"`. Must be one of `"primary"`, `"primary-light"`, `"primary-dark"`, `"secondary"`, `"secondary-light"`, `"secondary-dark"`, `"tertiary"`, `"tertiary-light"`, `"tertiary-dark"`, `"error"`.
For browsers that support the [Extensibility API](https://developer.chrome.com/docs/devtools/performance/extension) you can use the `detail` parameter to provide more details in a `devtools` object that will be used to display this in performance profiles:
98
+
99
+
```js
100
+
// Marker indicating when the processed image was uploaded
101
+
performance.mark("Image Upload", {
102
+
detail: {
103
+
devtools: {
104
+
dataType:"marker",
105
+
color:"secondary",
106
+
properties: [
107
+
["Image Size", "2.5MB"],
108
+
["Upload Destination", "Cloud Storage"],
109
+
],
110
+
tooltipText:"Processed image uploaded",
111
+
},
112
+
},
113
+
});
114
+
```
115
+
83
116
### Reserved names
84
117
85
118
Note in order to maintain backwards compatibility, names that are part of the deprecated {{domxref("PerformanceTiming")}} interface can't be used. The following example throws:
Copy file name to clipboardExpand all lines: files/en-us/web/api/performance/measure/index.md
+55Lines changed: 55 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,20 +39,37 @@ To only provide an `endMark`, you need to provide an empty `measureOptions` obje
39
39
- : An object that may contain measure options.
40
40
-`detail` {{optional_inline}}
41
41
- : Arbitrary metadata to be included in the measure. Defaults to `null`. Must be [structured-cloneable](/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm).
42
+
-`devtools`
43
+
- : Some browsers have use a structured `devtools` object within the `detail` object as part of an Extensibility API that surfaces these in custom tracks in performance traces. See the [Chrome's Extensibility API documentation](https://developer.chrome.com/docs/devtools/performance/extension#inject_your_data_with_the_user_timings_api) for more information.
44
+
-`dataType` {{experimental_inline}}
45
+
- : String with a value of `track-entry` (for defining a new track) or `marker` (for defining an entry in a track).
- : Defaults to `"primary"`. Must be one of `"primary"`, `"primary-light"`, `"primary-dark"`, `"secondary"`, `"secondary-light"`, `"secondary-dark"`, `"tertiary"`, `"tertiary-light"`, `"tertiary-dark"`, `"error"`.
- : Timestamp ({{domxref("DOMHighResTimeStamp")}}) to be used as the start time, or string that names a {{domxref("PerformanceMark")}} to use for the start time.
44
59
45
60
If this is a string naming a {{domxref("PerformanceMark")}}, then it is defined in the same way as `startMark`.
46
61
47
62
-`duration` {{optional_inline}}
48
63
- : Duration (in milliseconds) between the start and end mark times. If omitted, this defaults to {{domxref("performance.now()")}}; the time that has elapsed since the context was created. If provided, you must also specify either `start` or `end` but not both.
64
+
49
65
-`end` {{optional_inline}}
50
66
- : Timestamp ({{domxref("DOMHighResTimeStamp")}}) to be used as the end time, or string that names a {{domxref("PerformanceMark")}} to use for the end time.
51
67
52
68
If this is a string naming a {{domxref("PerformanceMark")}}, then it is defined in the same way as `endMark`.
53
69
54
70
-`startMark` {{optional_inline}}
55
71
- : A string naming a {{domxref("PerformanceMark")}} in the performance timeline. The {{domxref("PerformanceEntry.startTime")}} property of this mark will be used for calculating the measure.
72
+
56
73
-`endMark` {{optional_inline}}
57
74
- : A string naming a {{domxref("PerformanceMark")}} in the performance timeline. The {{domxref("PerformanceEntry.startTime")}} property of this mark will be used for calculating the measure.
58
75
If you want to pass this argument, you must also pass either `startMark` or an empty `measureOptions` object.
For browsers that support the [Extensibility API](https://developer.chrome.com/docs/devtools/performance/extension) you can use the `detail` parameter to provide more details in a `devtools` object that will be used to display this in performance profiles:
- : Returns arbitrary metadata that has been included in the mark upon construction.
38
-
39
37
## Instance methods
40
38
41
39
This interface has no methods.
@@ -44,6 +42,8 @@ This interface has no methods.
44
42
45
43
See the example in [Using the User Timing API](/en-US/docs/Web/API/Performance_API/User_timing).
46
44
45
+
Chrome DevTools uses `performance.mark()` and in particular a structured `detail` property as part of its extensibility API that surfaces these in custom tracks in performance traces. See the example in [Performance: mark() method](/en-US/docs/Web/API/Performance/mark) page and the [Chrome's extensibility API documentation](https://developer.chrome.com/docs/devtools/performance/extension#inject_your_data_with_the_user_timings_api) for more information and examples.
- : Some browsers have use a structured `devtools` object within the `detail` object as part of an Extensibility API that surfaces these in custom tracks in performance traces. See the [Chrome's Extensibility API documentation](https://developer.chrome.com/docs/devtools/performance/extension#inject_your_data_with_the_user_timings_api) for more information.
32
+
-`dataType` {{experimental_inline}}
33
+
- : A string which must be set to `marker`. Identifies as a marker.
- : Defaults to `"primary"`. Must be one of `"primary"`, `"primary-light"`, `"primary-dark"`, `"secondary"`, `"secondary-light"`, `"secondary-dark"`, `"tertiary"`, `"tertiary-light"`, `"tertiary-dark"`, `"error"`.
For browsers that support the [Extensibility API](https://developer.chrome.com/docs/devtools/performance/extension) you can use the `detail` parameter to provide more details in a `devtools` object that will be used to display this in performance profiles:
71
+
72
+
```js
73
+
// Marker indicating when the processed image was uploaded
- : Contains arbitrary metadata about the measure.
20
18
21
-
In addition, it extends the following {{domxref("PerformanceEntry")}} properties by qualifying/constraining the properties as follows:
19
+
This interface extends the following {{domxref("PerformanceEntry")}} properties by qualifying/constraining the properties as follows:
22
20
23
21
- {{domxref("PerformanceEntry.entryType")}}
24
22
- : Returns `"measure"`.
@@ -37,6 +35,8 @@ This interface has no methods.
37
35
38
36
See the example in [Using the User Timing API](/en-US/docs/Web/API/Performance_API/User_timing).
39
37
38
+
Chrome DevTools uses `performance.measure()` and in particular a structured `detail` property as part of its extensibility API that surfaces these in custom tracks in performance traces. See the example in [Performance: measure() method](/en-US/docs/Web/API/Performance/measure) page and the [Chrome's extensibility API documentation](https://developer.chrome.com/docs/devtools/performance/extension#inject_your_data_with_the_user_timings_api) for more information and examples.
0 commit comments