stripe / stripe-ruby

Ruby library for the Stripe API.
https://stripe.com
MIT License
1.96k stars 548 forks source link

Start tracking `StripeClient#request` usage #1396

Closed anniel-stripe closed 6 months ago

anniel-stripe commented 6 months ago

The best way I could think of doing this is by setting @usage on the StripeClient instance when request is called and appending it to the existing usage when setting last_request_metrics.

Note that in the tests, we need to send 2 requests, and the second request is the one that has usage telemetry for the first request (since the information is recorded in *last*_request_metrics).