Skip to content

Commit

Permalink
feat(packages/sui-react-web-vitals): add effectiveConnection, deviceM…
Browse files Browse the repository at this point in the history
…emory and hardwareConcurrency t
  • Loading branch information
Ivan Martinez authored and Ivan Martinez committed Feb 8, 2024
1 parent ee4769a commit e8abcd7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/sui-react-web-vitals/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ export default function WebVitalsReporter({

const target = getTarget({name, attribution})

const {effectiveConnection, deviceMemory, hardwareConcurrency} = browser || {}

logger.cwv({
name: `cwv.${name.toLowerCase()}`,
amount,
Expand All @@ -111,7 +113,10 @@ export default function WebVitalsReporter({
target,
loadState: attribution.loadState,
visibilityState: document.visibilityState,
...(attribution.eventType && {eventType: attribution.eventType})
...(attribution.eventType && {eventType: attribution.eventType}),
effectiveConnection,
deviceMemory,
hardwareConcurrency
})
}

Expand Down

0 comments on commit e8abcd7

Please sign in to comment.