lib/webVitals/webVitalsSummary
Functions
'Read the “', Functions, '” section'processWebVitalsSummary()
'Read the “', processWebVitalsSummary(), '” section'function processWebVitalsSummary(data: WebVitalsResponseItem[]): WebVitalsSummary
Defined in: studiocms/packages/studiocms/src/lib/webVitals/webVitalsSummary.ts:21
Processes an array of web vitals response items and generates a summary.
Parameters
'Read the “', Parameters, '” section'An array of WebVitalsResponseItem
objects to be processed.
A WebVitalsSummary
object containing the processed summary.
The function performs the following steps:
- Groups the input data by the
name
property. - Processes each metric group separately.
- Sorts the metrics within each group by
rating
andvalue
. - Assigns quartiles to each metric.
- Identifies the end of each rating group.
- Computes the sample size for each metric group.
- Computes histogram densities for each rating.
- Computes the 75th percentile (P75) for each metric group.
- Filters the final results based on specific conditions.