loadtest
Advanced tools
Comparing version 3.0.8 to 3.0.9
@@ -137,2 +137,5 @@ 'use strict'; | ||
} | ||
if (this.operation.options.maxRequests && this.operation.requests >= this.operation.options.maxRequests) return | ||
this.operation.requests += 1; | ||
const id = this.operation.latency.start(); | ||
@@ -139,0 +142,0 @@ const requestFinished = this.getRequestFinisher(id); |
@@ -97,2 +97,3 @@ 'use strict'; | ||
this.requests = 0; | ||
this.completedRequests = 0; | ||
this.showTimer = null; | ||
@@ -120,5 +121,5 @@ this.stopTimeout = null; | ||
callback(error, result, next) { | ||
this.requests += 1; | ||
this.completedRequests += 1; | ||
if (this.options.maxRequests) { | ||
if (this.requests == this.options.maxRequests) { | ||
if (this.completedRequests == this.options.maxRequests) { | ||
this.stop(); | ||
@@ -125,0 +126,0 @@ } |
{ | ||
"name": "loadtest", | ||
"version": "3.0.8", | ||
"version": "3.0.9", | ||
"description": "Run load tests for your web application. Mostly ab-compatible interface, with an option to force requests per second. Includes an API for automated load testing.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/alexfernandez/loadtest", |
82207
1920