How to test rate limiting algorithm?
I am building an app that I hope (and believe) will rarely if ever hit up against the Smartsheet rate limits. But of course in building a resilient app, I have to consider that it might. So I have built out a framework for handling rate limiting, and of course can test that in a mocked environment, but I would like to do some final end to end tests to ensure that it actually works.
That said, I also want to be a good Smartsheet citizen and not slam the Smartsheet servers on purpose merely for my testing of rate limiting, unless that is the preferred best practice.
Anyone care to answer and/or maybe Smartsheet would weigh in with a preference?
Many thanks!
Best Answer
-
Hi @sgolux
Thank you for clarifying! No, there currently isn't a way to temporarily set a test context like this. I suppose you'll need to just go ahead and slam away.
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Answers
-
Hi @sgolux
Smartsheet has an exponential backoff logic built into all the SDKs already. I would suggest that this might be a good starting point to see how that code works!
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
Hi @Genevieve P. - so grateful for your pointer. But I think my question may have been unclear.
I was not asking about HOW to implement the logic. I have already done so.
My question is that now I would like to TEST my code in a non-mocked context where I actually get Smartsheet to issue the rate limit pattern in response to my requests. I want a testing framework to test my code.
I could of course do this by simply slamming hundreds of requests at Smartsheet in order to trigger rate limiting. But it seems not very neighborly to do that intentionally. If there is a way that I can either issue a test request that will "rate limit" or temporarily set a test context where I am limited to (say) ten requests a minute rather than 300, then I would be able to test my code.
Is there anything like that?
Many thanks.
-
Hi @sgolux
Thank you for clarifying! No, there currently isn't a way to temporarily set a test context like this. I suppose you'll need to just go ahead and slam away.
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
This content has been removed.
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 495 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives