Skip to content

Commit

Permalink
chore: update LCP, CLS, and FID schemas with attributions
Browse files Browse the repository at this point in the history
  • Loading branch information
williazz committed Aug 23, 2023
1 parent 8bc188f commit 9214c0a
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 3 deletions.
31 changes: 30 additions & 1 deletion src/event-schemas/cumulative-layout-shift-event.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,36 @@
},
"value": {
"type": "number",
"description": "Value of the cls metric"
"description": "Largest burst of unexpected layout shifts during a page's lifespan"
},
"attribution": {
"type": "object",
"description": "Attributions for CLS",
"properties": {
"largestShiftTarget": {
"type": "string",
"description": "First element in the largest layout shift contributing to CLS score"
},
"largestShiftValue": {
"type": "number",
"description": "Value of CLS' single largest shift"
},
"largestShiftTime": {
"type": "number",
"description": "DOMHighResTimeStamp of CLS' single largest shift"
},
"loadState": {
"type": "string",
"enum": [
"loading",
"dom-interactive",
"dom-content-loaded",
"complete"
],
"description": "LoadState during CLS' single largest shift"
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
Expand Down
32 changes: 31 additions & 1 deletion src/event-schemas/first-input-delay-event.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,37 @@
},
"value": {
"type": "number",
"description": "Value of the fid metric"
"description": "Time from first user interaction until the main thread is next idle"
},
"attribution": {
"type": "object",
"description": "Attributions for FID",
"properties": {
"eventTarget": {
"type": "string",
"description": "Selector of the element targeted by first user interaction"
},
"eventType": {
"type": "string",
"description": "Type of event dispatched by first user interaction"
},
"eventTime": {
"type": "number",
"description": "Timestamp of user first user interaction"
},
"loadState": {
"type": "string",
"enum": [
"loading",
"dom-interactive",
"dom-content-loaded",
"complete"
],
"description": "LoadState of the document during first user interaction"
}
},
"required": ["eventTarget", "eventType", "eventTime", "loadState"],
"additionalProperties": false
}
},
"additionalProperties": false,
Expand Down
39 changes: 38 additions & 1 deletion src/event-schemas/largest-contentful-paint-event.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,44 @@
},
"value": {
"type": "number",
"description": "Value of the lcp metric"
"description": "Time until the largest element before first user interaction is rendered"
},
"attribution": {
"type": "object",
"description": "Attributions for CLS",
"properties": {
"element": {
"type": "string",
"description": "CSS selector of LCP resource"
},
"url": {
"type": "string",
"description": "URL source of the LCP resource's image, if any"
},
"timeToFirstByte": {
"type": "number",
"description": "Duration until first byte of response"
},
"resourceLoadDelay": {
"type": "number",
"description": "Duration after TTFP until LCP resource begins loading"
},
"resourceLoadTime": {
"type": "number",
"description": "Duration loading the LCP resource"
},
"elementRenderDelay": {
"type": "number",
"description": "Duration rendering the LCP resource"
}
},
"required": [
"timeToFirstByte",
"resourceLoadDelay",
"resourceLoadTime",
"elementRenderDelay"
],
"additionalProperties": false
}
},
"additionalProperties": false,
Expand Down

0 comments on commit 9214c0a

Please sign in to comment.