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

Caching of auth client regressed by #705 #822

Closed
ofrobots opened this issue Aug 26, 2015 · 2 comments
Closed

Caching of auth client regressed by #705 #822

ofrobots opened this issue Aug 26, 2015 · 2 comments
Assignees

Comments

@ofrobots
Copy link
Contributor

I believe that PR #705 regressed the earlier fix to cache the auth client I contributed in #661. This means that a new cache client is created on each API request we make, adding an unnecessary performance overhead. Here's some Cloud Trace output I get:

image

Note the extra 141ms added to this request, and every other request.

The cause is that the function makeAuthorizedRequest now passes a brand new object to util.makeRequest each time. We cache the authClient on that object, which is temporary and not available the next time through.

Would it be possible add a test for this to make sure this doesn't get regressed?

@stephenplusplus
Copy link
Contributor

Good catch, sorry to introduce the regression. This is a good time to incorporate https://github.com/stephenplusplus/google-auto-auth into gcloud, which will cache the client for us.

@stephenplusplus stephenplusplus self-assigned this Aug 26, 2015
@ofrobots
Copy link
Contributor Author

Ooh, google-auto-auth looks interesting. Let me see if we can use it in @google/cloud-trace.

sofisl pushed a commit that referenced this issue Nov 11, 2022
feat: added more Environment RPCs
feat: added Versions service
feat: added Fulfillment service
feat: added TextToSpeechSettings.
refactor!: helper agentPath becomes projectAgentPath
refactor!: helper intentPath becomes projectAgentIntentPath
refactor!: helper entityTypePath becomes projectAgentEntityTypePath
PiperOrigin-RevId: 372230736
Fixes #822
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

No branches or pull requests

2 participants