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: docs/assertions.md
+17
Original file line number
Diff line number
Diff line change
@@ -101,6 +101,23 @@ The below example warns when FCP is above 2 seconds on _all_ pages and warns whe
101
101
}
102
102
```
103
103
104
+
### User Timings
105
+
106
+
Your custom user timings using [`performance.mark`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark) and [`performance.measure`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure) can be asserted against as well.
107
+
108
+
The general format for asserting against a user timing value is `"user-timings:<kebab-cased-name>": ["<level>", {maxNumericValue: <value in milliseconds>}]`. For example, if you wanted to assert that a mark with name `My Custom Mark` started within the first 2s of page load and that a measure `my:custom-@-Measure` lasted fewer than 50 ms you would use the following assertions config.
109
+
110
+
Note that only the first matching entry with the name will be used from each run and the rest will be ignored.
0 commit comments