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

Add performance measurement to Cart AJAX #3719

Merged
merged 1 commit into from
Feb 21, 2025
Merged

Conversation

haeky
Copy link
Contributor

@haeky haeky commented Feb 6, 2025

PR Summary:

Start capturing RUM around cart interaction to express the buyers' experience when going through Dawn. These metrics will be extracted by perf-kit and emitted to our data pipeline.

What approach did you take?

Adding a Performance to be used in different cart operations.

  • Performance.measureFromEvent: Measure against a starting event. This is useful when we need to measure the end of an asynchronous event.
  • Performance.measure: Measure the time elapsed in a callback.

Testing steps/scenarios

Using the demo store, add an item to the store. Afterward, using the console, type performance.getEntriesByType("measure"); and you should see performance measurement. Here's the other different scenario to test:

  • Changing the quantity
  • Removing a line
  • Changing a note

Demo links

Checklist

Copy link
Contributor

@ludoboludo ludoboludo left a comment

Choose a reason for hiding this comment

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

Looks good, just gotta revert the change for the settings_data.json

@haeky haeky force-pushed the performance-measurement branch from 7bcf90b to 5be4190 Compare February 7, 2025 15:17
Copy link
Contributor

@tyleralsbury tyleralsbury left a comment

Choose a reason for hiding this comment

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

Tested cart functionality and it all seems good.

assets/global.js Outdated
`${metricName}:end`
);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
}

@haeky haeky force-pushed the performance-measurement branch 2 times, most recently from ea6035c to b3ade72 Compare February 21, 2025 16:03
@haeky haeky force-pushed the performance-measurement branch from b3ade72 to 2d3c3c2 Compare February 21, 2025 16:09
@haeky haeky merged commit 1a6f4b7 into main Feb 21, 2025
8 checks passed
@haeky haeky deleted the performance-measurement branch February 21, 2025 16:33
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