MM-57878 Add PerformanceReporter for clientside performance metrics (#26800)

* Define rough code for PerformanceReporter

* Create a component to manage the PerformanceReporter

* Start adding tests for PerformanceReporter

* Add test for web vitals reporting

* Update schema to more closely match the API spec

* Collect marks as counters and further update structure of API payload

* Add some outstanding TODOs about the API structure

* Add counter for long tasks

* Add EnableClientMetrics without any System Console UI

* Have PerformanceReporter use EnableClientMetrics

* Have the PerformanceReporter only report results when logged in

* Add test for having PerformanceReporter fall back to fetch

* Stop logging errors for measurements failing

* Remove buffered from observer

* Remove the Mystery Ampersand

* Still record marks with telemetry actions even if telemetry is disabled

* Add timestamps to performance reports

* Reuse the new telemetry code for the old telemetry

* The second half of the last commit

* Use Node performance libraries in all tests

* Set version of PerformanceReport

* Switch to the proper version of EnableClientMetrics

* Remove TODO for unneeded field

* Add user agent and platform detection

* Updated metrics API route
Этот коммит содержится в:
Harrison Healey
2024-05-09 12:50:52 -04:00
коммит произвёл GitHub
родитель d6a8ad0d55
Коммит de3c7ad544
22 изменённых файлов: 1188 добавлений и 67 удалений

Просмотреть файл

@@ -491,6 +491,10 @@ export default class Client4 {
return `${this.getLimitsRoute()}/server`;
}
getClientMetricsRoute() {
return `${this.getBaseRoute()}/perf`;
}
getCSRFFromCookie() {
if (typeof document !== 'undefined' && typeof document.cookie !== 'undefined') {
const cookies = document.cookie.split(';');