Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fireperf web vitals #8644

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Fireperf web vitals #8644

wants to merge 7 commits into from

Conversation

bryanatkinson
Copy link

  • Add support for capturing web vitals metrics in Firebase performance for Web (Largest Contentful Paint, Interaction to Next Paint, Cumulative Layout Shift)
  • Modifies export to use sendBeacon instead of fetch API, and shifts the upload time to the first time the page is hidden or unloaded.

Copy link

changeset-bot bot commented Nov 18, 2024

⚠️ No Changeset found

Latest commit: fe72ce1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 18, 2024

Size Report 1

Affected Products

  • @firebase/performance

    TypeBase (e3e2078)Merge (1ea5103)Diff
    browser29.1 kB30.4 kB+1.27 kB (+4.4%)
    main29.5 kB30.8 kB+1.32 kB (+4.5%)
    module29.1 kB30.4 kB+1.27 kB (+4.4%)
  • bundle

    TypeBase (e3e2078)Merge (1ea5103)Diff
    performance (trace)51.8 kB62.1 kB+10.3 kB (+19.9%)
  • firebase

    TypeBase (e3e2078)Merge (1ea5103)Diff
    firebase-compat.js794 kB804 kB+9.98 kB (+1.3%)
    firebase-performance-compat.js30.8 kB40.8 kB+9.96 kB (+32.3%)
    firebase-performance-standalone-compat.js93.7 kB104 kB+10.2 kB (+10.9%)
    firebase-performance.js35.1 kB45.3 kB+10.3 kB (+29.3%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/cX33vDHMZ9.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 18, 2024

Size Analysis Report 1

Affected Products

  • @firebase/performance

    • getPerformance

      Size

      TypeBase (e3e2078)Merge (1ea5103)Diff
      size18.0 kB18.7 kB+712 B (+4.0%)
      size-with-ext-deps51.7 kB62.0 kB+10.3 kB (+19.9%)

      Dependency

      TypeBase (e3e2078)Merge (1ea5103)Diff
      functions

      50 dependencies

      addToQueue
      changeInitializationStatus
      configValid
      convertMetricValueToInteger
      createNetworkRequestEntry
      createUserTimingTrace
      dispatchQueueEvents
      getApiKey
      getAppId
      getApplicationInfo
      getAuthTokenPromise
      getConfig
      getDocumentReadyComplete
      getEffectiveConnectionType
      getIid
      getIidPromise
      getInitializationPromise
      getPerformance
      getProjectId
      getRemoteConfig
      getServiceWorkerStatus
      getStoredConfig
      getVisibilityState
      initializePerf
      isPerfInitialized
      isValidCustomAttributeName
      isValidCustomAttributeValue
      isValidMetricName
      logNetworkRequest
      logTrace
      mergeStrings
      postToFlEndpoint
      processConfig
      processQueue
      registerPerformance
      sendEventsToFl
      sendLog
      sendTraceLog
      serializeNetworkRequest
      serializeTrace
      serializer
      setupApi
      setupNetworkRequests
      setupOobResources
      setupOobTraces
      setupTransportService
      setupUserTimingTraces
      shouldLogAfterSampling
      storeConfig
      transportHandler

      52 dependencies

      addToQueue
      changeInitializationStatus
      configValid
      convertMetricValueToInteger
      createNetworkRequestEntry
      createUserTimingTrace
      dispatchQueueEvents
      flushLogs
      flushQueuedEvents
      getApiKey
      getAppId
      getApplicationInfo
      getAuthTokenPromise
      getConfig
      getDocumentReadyComplete
      getEffectiveConnectionType
      getIid
      getIidPromise
      getInitializationPromise
      getPerformance
      getProjectId
      getRemoteConfig
      getServiceWorkerStatus
      getStoredConfig
      getVisibilityState
      initializePerf
      isPerfInitialized
      isValidCustomAttributeName
      isValidCustomAttributeValue
      isValidMetricName
      logNetworkRequest
      logTrace
      mergeStrings
      postToFlEndpoint
      processConfig
      processQueue
      registerPerformance
      sendLog
      sendOobTrace
      sendTraceLog
      serializeNetworkRequest
      serializeTrace
      serializer
      setupApi
      setupNetworkRequests
      setupOobResources
      setupOobTraces
      setupTransportService
      setupUserTimingTraces
      shouldLogAfterSampling
      storeConfig
      transportHandler

      + flushLogs
      + flushQueuedEvents
      + sendOobTrace
      - sendEventsToFl

      variables

      46 dependencies

      ATTRIBUTE_FORMAT_REGEX
      CONFIG_EXPIRY_LOCAL_STORAGE_KEY
      CONFIG_LOCAL_STORAGE_KEY
      COULD_NOT_GET_CONFIG_MSG
      DEFAULT_CONFIGS
      DEFAULT_ENTRY_NAME
      DEFAULT_REMAINING_TRIES
      DEFAULT_SEND_INTERVAL_MS
      ERROR_DESCRIPTION_MAP
      ERROR_FACTORY
      FID_WAIT_TIME_MS
      FIRST_CONTENTFUL_PAINT_COUNTER_NAME
      FIRST_INPUT_DELAY_COUNTER_NAME
      FIRST_PAINT_COUNTER_NAME
      FIS_AUTH_PREFIX
      INITIAL_SEND_TIME_DELAY_MS
      MAX_ATTRIBUTE_NAME_LENGTH
      MAX_ATTRIBUTE_VALUE_LENGTH
      MAX_EVENT_COUNT_PER_REQUEST
      MAX_METRIC_NAME_LENGTH
      OOB_TRACE_PAGE_LOAD_PREFIX
      REMOTE_CONFIG_SDK_VERSION
      RESERVED_ATTRIBUTE_PREFIXES
      RESERVED_AUTO_PREFIX
      SDK_VERSION
      SERVICE
      SERVICE_NAME
      TRACE_MEASURE_PREFIX
      TRACE_START_MARK_PREFIX
      TRACE_STOP_MARK_PREFIX
      VisibilityState
      apiInstance
      consoleLogger
      factory
      iid
      initializationPromise
      initializationStatus
      isTransportSetup
      logger
      name
      oobMetrics
      queue
      remainingTries
      settingsServiceInstance
      version
      windowInstance

      53 dependencies

      ATTRIBUTE_FORMAT_REGEX
      CONFIG_EXPIRY_LOCAL_STORAGE_KEY
      CONFIG_LOCAL_STORAGE_KEY
      COULD_NOT_GET_CONFIG_MSG
      CUMULATIVE_LAYOUT_SHIFT_ATTRIBUTE_NAME
      CUMULATIVE_LAYOUT_SHIFT_METRIC_NAME
      DEFAULT_CONFIGS
      DEFAULT_ENTRY_NAME
      DEFAULT_SEND_INTERVAL_MS
      ERROR_DESCRIPTION_MAP
      ERROR_FACTORY
      FID_WAIT_TIME_MS
      FIRST_CONTENTFUL_PAINT_COUNTER_NAME
      FIRST_INPUT_DELAY_COUNTER_NAME
      FIRST_PAINT_COUNTER_NAME
      FIS_AUTH_PREFIX
      INITIAL_SEND_TIME_DELAY_MS
      INTERACTION_TO_NEXT_PAINT_ATTRIBUTE_NAME
      INTERACTION_TO_NEXT_PAINT_METRIC_NAME
      LARGEST_CONTENTFUL_PAINT_ATTRIBUTE_NAME
      LARGEST_CONTENTFUL_PAINT_METRIC_NAME
      MAX_ATTRIBUTE_NAME_LENGTH
      MAX_ATTRIBUTE_VALUE_LENGTH
      MAX_EVENT_COUNT_PER_REQUEST
      MAX_METRIC_NAME_LENGTH
      OOB_TRACE_PAGE_LOAD_PREFIX
      REMOTE_CONFIG_SDK_VERSION
      RESERVED_ATTRIBUTE_PREFIXES
      RESERVED_AUTO_PREFIX
      SDK_VERSION
      SERVICE
      SERVICE_NAME
      TRACE_MEASURE_PREFIX
      TRACE_START_MARK_PREFIX
      TRACE_STOP_MARK_PREFIX
      VisibilityState
      apiInstance
      consoleLogger
      factory
      firstInputDelay
      iid
      initializationPromise
      initializationStatus
      isTransportSetup
      logger
      name
      oobMetrics
      queue
      sentPageLoadTrace
      settingsServiceInstance
      version
      webVitalMetrics
      windowInstance

      11 dependency diffs

      + CUMULATIVE_LAYOUT_SHIFT_ATTRIBUTE_NAME
      + CUMULATIVE_LAYOUT_SHIFT_METRIC_NAME
      + INTERACTION_TO_NEXT_PAINT_ATTRIBUTE_NAME
      + INTERACTION_TO_NEXT_PAINT_METRIC_NAME
      + LARGEST_CONTENTFUL_PAINT_ATTRIBUTE_NAME
      + LARGEST_CONTENTFUL_PAINT_METRIC_NAME
      + firstInputDelay
      + sentPageLoadTrace
      + webVitalMetrics
      - DEFAULT_REMAINING_TRIES
      - remainingTries

      External Dependency

      ModuleBase (e3e2078)Merge (1ea5103)Diff
      web-vitals/attribution

      onCLS
      onINP
      onLCP

      + onCLS
      + onINP
      + onLCP

    • initializePerformance

      Size

      TypeBase (e3e2078)Merge (1ea5103)Diff
      size18.2 kB18.9 kB+712 B (+3.9%)
      size-with-ext-deps45.1 kB55.4 kB+10.3 kB (+22.8%)

      Dependency

      TypeBase (e3e2078)Merge (1ea5103)Diff
      functions

      50 dependencies

      addToQueue
      changeInitializationStatus
      configValid
      convertMetricValueToInteger
      createNetworkRequestEntry
      createUserTimingTrace
      dispatchQueueEvents
      getApiKey
      getAppId
      getApplicationInfo
      getAuthTokenPromise
      getConfig
      getDocumentReadyComplete
      getEffectiveConnectionType
      getIid
      getIidPromise
      getInitializationPromise
      getProjectId
      getRemoteConfig
      getServiceWorkerStatus
      getStoredConfig
      getVisibilityState
      initializePerf
      initializePerformance
      isPerfInitialized
      isValidCustomAttributeName
      isValidCustomAttributeValue
      isValidMetricName
      logNetworkRequest
      logTrace
      mergeStrings
      postToFlEndpoint
      processConfig
      processQueue
      registerPerformance
      sendEventsToFl
      sendLog
      sendTraceLog
      serializeNetworkRequest
      serializeTrace
      serializer
      setupApi
      setupNetworkRequests
      setupOobResources
      setupOobTraces
      setupTransportService
      setupUserTimingTraces
      shouldLogAfterSampling
      storeConfig
      transportHandler

      52 dependencies

      addToQueue
      changeInitializationStatus
      configValid
      convertMetricValueToInteger
      createNetworkRequestEntry
      createUserTimingTrace
      dispatchQueueEvents
      flushLogs
      flushQueuedEvents
      getApiKey
      getAppId
      getApplicationInfo
      getAuthTokenPromise
      getConfig
      getDocumentReadyComplete
      getEffectiveConnectionType
      getIid
      getIidPromise
      getInitializationPromise
      getProjectId
      getRemoteConfig
      getServiceWorkerStatus
      getStoredConfig
      getVisibilityState
      initializePerf
      initializePerformance
      isPerfInitialized
      isValidCustomAttributeName
      isValidCustomAttributeValue
      isValidMetricName
      logNetworkRequest
      logTrace
      mergeStrings
      postToFlEndpoint
      processConfig
      processQueue
      registerPerformance
      sendLog
      sendOobTrace
      sendTraceLog
      serializeNetworkRequest
      serializeTrace
      serializer
      setupApi
      setupNetworkRequests
      setupOobResources
      setupOobTraces
      setupTransportService
      setupUserTimingTraces
      shouldLogAfterSampling
      storeConfig
      transportHandler

      + flushLogs
      + flushQueuedEvents
      + sendOobTrace
      - sendEventsToFl

      variables

      46 dependencies

      ATTRIBUTE_FORMAT_REGEX
      CONFIG_EXPIRY_LOCAL_STORAGE_KEY
      CONFIG_LOCAL_STORAGE_KEY
      COULD_NOT_GET_CONFIG_MSG
      DEFAULT_CONFIGS
      DEFAULT_ENTRY_NAME
      DEFAULT_REMAINING_TRIES
      DEFAULT_SEND_INTERVAL_MS
      ERROR_DESCRIPTION_MAP
      ERROR_FACTORY
      FID_WAIT_TIME_MS
      FIRST_CONTENTFUL_PAINT_COUNTER_NAME
      FIRST_INPUT_DELAY_COUNTER_NAME
      FIRST_PAINT_COUNTER_NAME
      FIS_AUTH_PREFIX
      INITIAL_SEND_TIME_DELAY_MS
      MAX_ATTRIBUTE_NAME_LENGTH
      MAX_ATTRIBUTE_VALUE_LENGTH
      MAX_EVENT_COUNT_PER_REQUEST
      MAX_METRIC_NAME_LENGTH
      OOB_TRACE_PAGE_LOAD_PREFIX
      REMOTE_CONFIG_SDK_VERSION
      RESERVED_ATTRIBUTE_PREFIXES
      RESERVED_AUTO_PREFIX
      SDK_VERSION
      SERVICE
      SERVICE_NAME
      TRACE_MEASURE_PREFIX
      TRACE_START_MARK_PREFIX
      TRACE_STOP_MARK_PREFIX
      VisibilityState
      apiInstance
      consoleLogger
      factory
      iid
      initializationPromise
      initializationStatus
      isTransportSetup
      logger
      name
      oobMetrics
      queue
      remainingTries
      settingsServiceInstance
      version
      windowInstance

      53 dependencies

      ATTRIBUTE_FORMAT_REGEX
      CONFIG_EXPIRY_LOCAL_STORAGE_KEY
      CONFIG_LOCAL_STORAGE_KEY
      COULD_NOT_GET_CONFIG_MSG
      CUMULATIVE_LAYOUT_SHIFT_ATTRIBUTE_NAME
      CUMULATIVE_LAYOUT_SHIFT_METRIC_NAME
      DEFAULT_CONFIGS
      DEFAULT_ENTRY_NAME
      DEFAULT_SEND_INTERVAL_MS
      ERROR_DESCRIPTION_MAP
      ERROR_FACTORY
      FID_WAIT_TIME_MS
      FIRST_CONTENTFUL_PAINT_COUNTER_NAME
      FIRST_INPUT_DELAY_COUNTER_NAME
      FIRST_PAINT_COUNTER_NAME
      FIS_AUTH_PREFIX
      INITIAL_SEND_TIME_DELAY_MS
      INTERACTION_TO_NEXT_PAINT_ATTRIBUTE_NAME
      INTERACTION_TO_NEXT_PAINT_METRIC_NAME
      LARGEST_CONTENTFUL_PAINT_ATTRIBUTE_NAME
      LARGEST_CONTENTFUL_PAINT_METRIC_NAME
      MAX_ATTRIBUTE_NAME_LENGTH
      MAX_ATTRIBUTE_VALUE_LENGTH
      MAX_EVENT_COUNT_PER_REQUEST
      MAX_METRIC_NAME_LENGTH
      OOB_TRACE_PAGE_LOAD_PREFIX
      REMOTE_CONFIG_SDK_VERSION
      RESERVED_ATTRIBUTE_PREFIXES
      RESERVED_AUTO_PREFIX
      SDK_VERSION
      SERVICE
      SERVICE_NAME
      TRACE_MEASURE_PREFIX
      TRACE_START_MARK_PREFIX
      TRACE_STOP_MARK_PREFIX
      VisibilityState
      apiInstance
      consoleLogger
      factory
      firstInputDelay
      iid
      initializationPromise
      initializationStatus
      isTransportSetup
      logger
      name
      oobMetrics
      queue
      sentPageLoadTrace
      settingsServiceInstance
      version
      webVitalMetrics
      windowInstance

      11 dependency diffs

      + CUMULATIVE_LAYOUT_SHIFT_ATTRIBUTE_NAME
      + CUMULATIVE_LAYOUT_SHIFT_METRIC_NAME
      + INTERACTION_TO_NEXT_PAINT_ATTRIBUTE_NAME
      + INTERACTION_TO_NEXT_PAINT_METRIC_NAME
      + LARGEST_CONTENTFUL_PAINT_ATTRIBUTE_NAME
      + LARGEST_CONTENTFUL_PAINT_METRIC_NAME
      + firstInputDelay
      + sentPageLoadTrace
      + webVitalMetrics
      - DEFAULT_REMAINING_TRIES
      - remainingTries

      External Dependency

      ModuleBase (e3e2078)Merge (1ea5103)Diff
      web-vitals/attribution

      onCLS
      onINP
      onLCP

      + onCLS
      + onINP
      + onLCP

    • trace

      Size

      TypeBase (e3e2078)Merge (1ea5103)Diff
      size17.9 kB18.6 kB+722 B (+4.0%)
      size-with-ext-deps44.5 kB54.8 kB+10.3 kB (+23.1%)

      Dependency

      TypeBase (e3e2078)Merge (1ea5103)Diff
      functions

      50 dependencies

      addToQueue
      changeInitializationStatus
      configValid
      convertMetricValueToInteger
      createNetworkRequestEntry
      createUserTimingTrace
      dispatchQueueEvents
      getApiKey
      getAppId
      getApplicationInfo
      getAuthTokenPromise
      getConfig
      getDocumentReadyComplete
      getEffectiveConnectionType
      getIid
      getIidPromise
      getInitializationPromise
      getProjectId
      getRemoteConfig
      getServiceWorkerStatus
      getStoredConfig
      getVisibilityState
      initializePerf
      isPerfInitialized
      isValidCustomAttributeName
      isValidCustomAttributeValue
      isValidMetricName
      logNetworkRequest
      logTrace
      mergeStrings
      postToFlEndpoint
      processConfig
      processQueue
      registerPerformance
      sendEventsToFl
      sendLog
      sendTraceLog
      serializeNetworkRequest
      serializeTrace
      serializer
      setupApi
      setupNetworkRequests
      setupOobResources
      setupOobTraces
      setupTransportService
      setupUserTimingTraces
      shouldLogAfterSampling
      storeConfig
      trace
      transportHandler

      52 dependencies

      addToQueue
      changeInitializationStatus
      configValid
      convertMetricValueToInteger
      createNetworkRequestEntry
      createUserTimingTrace
      dispatchQueueEvents
      flushLogs
      flushQueuedEvents
      getApiKey
      getAppId
      getApplicationInfo
      getAuthTokenPromise
      getConfig
      getDocumentReadyComplete
      getEffectiveConnectionType
      getIid
      getIidPromise
      getInitializationPromise
      getProjectId
      getRemoteConfig
      getServiceWorkerStatus
      getStoredConfig
      getVisibilityState
      initializePerf
      isPerfInitialized
      isValidCustomAttributeName
      isValidCustomAttributeValue
      isValidMetricName
      logNetworkRequest
      logTrace
      mergeStrings
      postToFlEndpoint
      processConfig
      processQueue
      registerPerformance
      sendLog
      sendOobTrace
      sendTraceLog
      serializeNetworkRequest
      serializeTrace
      serializer
      setupApi
      setupNetworkRequests
      setupOobResources
      setupOobTraces
      setupTransportService
      setupUserTimingTraces
      shouldLogAfterSampling
      storeConfig
      trace
      transportHandler

      + flushLogs
      + flushQueuedEvents
      + sendOobTrace
      - sendEventsToFl

      variables

      46 dependencies

      ATTRIBUTE_FORMAT_REGEX
      CONFIG_EXPIRY_LOCAL_STORAGE_KEY
      CONFIG_LOCAL_STORAGE_KEY
      COULD_NOT_GET_CONFIG_MSG
      DEFAULT_CONFIGS
      DEFAULT_ENTRY_NAME
      DEFAULT_REMAINING_TRIES
      DEFAULT_SEND_INTERVAL_MS
      ERROR_DESCRIPTION_MAP
      ERROR_FACTORY
      FID_WAIT_TIME_MS
      FIRST_CONTENTFUL_PAINT_COUNTER_NAME
      FIRST_INPUT_DELAY_COUNTER_NAME
      FIRST_PAINT_COUNTER_NAME
      FIS_AUTH_PREFIX
      INITIAL_SEND_TIME_DELAY_MS
      MAX_ATTRIBUTE_NAME_LENGTH
      MAX_ATTRIBUTE_VALUE_LENGTH
      MAX_EVENT_COUNT_PER_REQUEST
      MAX_METRIC_NAME_LENGTH
      OOB_TRACE_PAGE_LOAD_PREFIX
      REMOTE_CONFIG_SDK_VERSION
      RESERVED_ATTRIBUTE_PREFIXES
      RESERVED_AUTO_PREFIX
      SDK_VERSION
      SERVICE
      SERVICE_NAME
      TRACE_MEASURE_PREFIX
      TRACE_START_MARK_PREFIX
      TRACE_STOP_MARK_PREFIX
      VisibilityState
      apiInstance
      consoleLogger
      factory
      iid
      initializationPromise
      initializationStatus
      isTransportSetup
      logger
      name
      oobMetrics
      queue
      remainingTries
      settingsServiceInstance
      version
      windowInstance

      53 dependencies

      ATTRIBUTE_FORMAT_REGEX
      CONFIG_EXPIRY_LOCAL_STORAGE_KEY
      CONFIG_LOCAL_STORAGE_KEY
      COULD_NOT_GET_CONFIG_MSG
      CUMULATIVE_LAYOUT_SHIFT_ATTRIBUTE_NAME
      CUMULATIVE_LAYOUT_SHIFT_METRIC_NAME
      DEFAULT_CONFIGS
      DEFAULT_ENTRY_NAME
      DEFAULT_SEND_INTERVAL_MS
      ERROR_DESCRIPTION_MAP
      ERROR_FACTORY
      FID_WAIT_TIME_MS
      FIRST_CONTENTFUL_PAINT_COUNTER_NAME
      FIRST_INPUT_DELAY_COUNTER_NAME
      FIRST_PAINT_COUNTER_NAME
      FIS_AUTH_PREFIX
      INITIAL_SEND_TIME_DELAY_MS
      INTERACTION_TO_NEXT_PAINT_ATTRIBUTE_NAME
      INTERACTION_TO_NEXT_PAINT_METRIC_NAME
      LARGEST_CONTENTFUL_PAINT_ATTRIBUTE_NAME
      LARGEST_CONTENTFUL_PAINT_METRIC_NAME
      MAX_ATTRIBUTE_NAME_LENGTH
      MAX_ATTRIBUTE_VALUE_LENGTH
      MAX_EVENT_COUNT_PER_REQUEST
      MAX_METRIC_NAME_LENGTH
      OOB_TRACE_PAGE_LOAD_PREFIX
      REMOTE_CONFIG_SDK_VERSION
      RESERVED_ATTRIBUTE_PREFIXES
      RESERVED_AUTO_PREFIX
      SDK_VERSION
      SERVICE
      SERVICE_NAME
      TRACE_MEASURE_PREFIX
      TRACE_START_MARK_PREFIX
      TRACE_STOP_MARK_PREFIX
      VisibilityState
      apiInstance
      consoleLogger
      factory
      firstInputDelay
      iid
      initializationPromise
      initializationStatus
      isTransportSetup
      logger
      name
      oobMetrics
      queue
      sentPageLoadTrace
      settingsServiceInstance
      version
      webVitalMetrics
      windowInstance

      11 dependency diffs

      + CUMULATIVE_LAYOUT_SHIFT_ATTRIBUTE_NAME
      + CUMULATIVE_LAYOUT_SHIFT_METRIC_NAME
      + INTERACTION_TO_NEXT_PAINT_ATTRIBUTE_NAME
      + INTERACTION_TO_NEXT_PAINT_METRIC_NAME
      + LARGEST_CONTENTFUL_PAINT_ATTRIBUTE_NAME
      + LARGEST_CONTENTFUL_PAINT_METRIC_NAME
      + firstInputDelay
      + sentPageLoadTrace
      + webVitalMetrics
      - DEFAULT_REMAINING_TRIES
      - remainingTries

      External Dependency

      ModuleBase (e3e2078)Merge (1ea5103)Diff
      web-vitals/attribution

      onCLS
      onINP
      onLCP

      + onCLS
      + onINP
      + onLCP

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/ikl60pGFIT.html

metric?: CoreVitalMetric
): void {
if (metric) {
trace.putMetric(metricKey, Math.floor(metric.value * 1000));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we document that cls score is multiplied by 1000 in our BE?

Comment on lines +153 to +161
setTimeout(() => {
Trace.createOobTrace(
performanceController,
navigationTimings,
paintTimings,
webVitalMetrics,
firstInputDelay
);
}, FID_WAIT_TIME_MS);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed anymore since we are always sending at the end of the page session. Since we call this on page unload, we don't need an extra timeout here.

* Force flush the queued events. Useful at page unload time to ensure all
* events are uploaded.
*/
export function flushQueuedEvents(): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to double check, regular traces/network requests should still be dispatched periodically before this flush is called right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants