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

Pass Mutation Name as Endpoint for GraphQL #1349

Merged
merged 7 commits into from
Jul 2, 2024

Conversation

richherrera
Copy link
Contributor

Summary of changes

  • For requests that go through GraphQL, we need to send the name of the mutation as the endpoint for our latency events

Checklist

  • Added a changelog entry

Authors

jaxdesmarais and others added 3 commits June 24, 2024 10:50
* fix constraints warning by adding leading and trailing constraints for nested stackViews
* remove print statement
@richherrera richherrera self-assigned this Jun 26, 2024
@richherrera richherrera requested a review from a team as a code owner June 26, 2024 18:38
let path = transaction.request.url?.path {
var path = transaction.request.url?.path {

if path.contains("graphql"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we able to add a unit test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, added: df95e39

Comment on lines +766 to +767
transactionMetrics.mockConnectStartDate = Date()
transactionMetrics.mockFetchStartDate = Date()
Copy link
Contributor

Choose a reason for hiding this comment

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

just curious, how are these two values different? 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FetchStartDate: The time when the task started fetching the resource, from the server or locally.
ConnectStartDate: The time immediately before the task started establishing a TCP connection to the server.

Apple has an amazing graphic in their documentation that would explain it better. Apple doc reference

Copy link
Contributor

@agedd agedd left a comment

Choose a reason for hiding this comment

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

lgtm! 🚀 jw what brought about introducing this change

@richherrera
Copy link
Contributor Author

lgtm! 🚀 jw what brought about introducing this change

Thanks for asking. Yes, this change is part of something that was pending in another PR. Currently, we're sending the endpoint of all requests to measure latency. Since the GraphQL requests are the same, the suggestion was to send the name of the mutation to identify it. I'll share some PRs with you in case you want to dive deeper into this.

Suggestion: #1321 (comment)
Android: 78883ff

Copy link
Contributor

@scannillo scannillo left a comment

Choose a reason for hiding this comment

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

Nice unit test 👏

@richherrera richherrera merged commit f1444f0 into main Jul 2, 2024
6 of 7 checks passed
@richherrera richherrera deleted the pass-mutation-name-graphql branch July 2, 2024 21:18
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.

5 participants