这是indexloc提供的服务,不要输入任何密码
Skip to content

chore: extract telemetry_handle creation into helper function #10008

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

Merged

Conversation

erikareads
Copy link
Contributor

Description

Small refactor pulling the logic for initializing the telemetry_handle and client into a helper function named initialize_telemetry_client. Previously, this initialization logic required a clarifying comment as well as nested match statements in the body of run which required time to read and understand.

This PR moves those nested match statements into a helper, reducing the cognitive load while reading run. This helper also centralizes logic for initialization, and allows us to remove a mut from telemetry_handle, since it's no longer being modified outside the helper.

@erikareads erikareads requested a review from a team as a code owner February 19, 2025 19:48
@turbo-orchestrator turbo-orchestrator bot added the needs: triage New issues get this label. Remove it after triage label Feb 19, 2025
Copy link

vercel bot commented Feb 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 7:48pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 7:48pm
examples-gatsby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 7:48pm
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 7:48pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 7:48pm
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 7:48pm
examples-svelte-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 7:48pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 7:48pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 7:48pm

Copy link
Member

@chris-olszewski chris-olszewski left a comment

Choose a reason for hiding this comment

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

Nice!

Totally out of scope of the PR, but it would be awesome if we could move AnonAPIClient::new to a different thread. On >>> FULL TURBO run it accounts for 73ms/328ms.
Screenshot 2025-02-19 at 3 51 53 PM

@erikareads erikareads merged commit f134a8d into main Feb 19, 2025
39 checks passed
@erikareads erikareads deleted the erikarowland/refactor-extract-telemetry-client-creation branch February 19, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: triage New issues get this label. Remove it after triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants