Im attempting to use the request and limiter modules in a test and getting an error. My code and error looks like this;
var request = require('request');
var RateLimiter = require('limiter').RateLimiter;
var limiter = new RateLimiter(100, 1000);
var throttledRequest = function() {
var requestArgs = routes;
limiter.removeTokens(1, function() {
request.apply(this, requestArgs);
});
};
The array can be quite large so I to limit the amount of requests that can be sent per second. I also want to implement exponential back off just in case the response is slower then expected but I haven’t gotten that far yet
You are kindof at the limits of what Postman can do. Consider looking into tools like JMeter or Gatling for setting such params.
You can add a delay after each request, thus limiting how many requests you send. I would export the list of requests to an external file and use them as iterations.
You cannot increase or decrease the rate.
Alternatively, you can simply build your own NodeJs script and run it separately from Postman.