Skip to content

Commit

Permalink
chore: updates to READMe and refining default values
Browse files Browse the repository at this point in the history
  • Loading branch information
pratik151192 committed Oct 31, 2023
1 parent 7742800 commit 6d98e56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/nodejs/rate-limiter/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function main() {
// default values
let totalRequests = 1000;
let randomDelayUpperBound = 60000;
let tpmLimit = 500;
let tpmLimit = 5000;

if (process.argv[2]) {
totalRequests = parseInt(process.argv[2], 10);
Expand All @@ -44,7 +44,8 @@ async function main() {
const tasks = [];
let currentUserIndex = 0;

console.log(`Simulating ${totalRequests} requests for each rate limiter with a random delay between requests upto a max of ${randomDelayUpperBound} milliseconds. The rate limiter allow ${tpmLimit} requests per minute.`);
console.log(`Simulating ${totalRequests} requests for each rate limiter with a random delay between requests upto a max of ${randomDelayUpperBound} milliseconds. The rate limiter allow ${tpmLimit} requests per minute.
The simulation uses ${userIDs.length} users and evenly divides requests for each user.`);

// Simulate for both rate limiters
for (const { limiter, metrics } of rateLimiters) {
Expand Down

0 comments on commit 6d98e56

Please sign in to comment.