loadtest
Advanced tools
Comparing version 3.0.3 to 3.0.4
@@ -39,2 +39,3 @@ #!/usr/bin/env node | ||
version: {key: 'V', description: 'Show version number and exit'}, | ||
proxy: {args: 1, description: 'Use a proxy for requests e.g. http://localhost:8080 '}, | ||
rps: {args: 1, description: 'Specify the requests per second for each client'}, | ||
@@ -41,0 +42,0 @@ agent: {description: 'Use a keep-alive http agent (deprecated)'}, |
declare namespace loadtest { | ||
export function loadTest(options: LoadTestOptions, err: Function): void; | ||
export function loadTest(options: LoadTestOptions, err: Function): void; | ||
export interface LoadTestOptions { | ||
url: string; | ||
concurrency?: number; | ||
maxRequests?: number; | ||
maxSeconds?: number; | ||
timeOut?: number; | ||
cookies?: string[]; | ||
headers?: { [headerName: string]: string }; | ||
method?: 'GET'|'POST'|'PUT'|'PATCH'|'DELETE'; | ||
body?: string|Object; | ||
contentType?: string; | ||
requestsPerSecond?: number; | ||
requestGenerator?(params: any, options: any, client: any, callback: Function); | ||
agentKeepAlive?: boolean; | ||
quiet?: boolean; | ||
indexParam?: boolean; | ||
insecure?: boolean; | ||
secureProtocol?: string; | ||
statusCallback?(latency: LoadTestResult, result: any, error: Error): void; | ||
} | ||
export interface LoadTestOptions { | ||
url: string; | ||
concurrency?: number; | ||
maxRequests?: number; | ||
maxSeconds?: number; | ||
timeOut?: number; | ||
cookies?: string[]; | ||
headers?: { [headerName: string]: string }; | ||
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; | ||
body?: string | Object; | ||
contentType?: string; | ||
requestsPerSecond?: number; | ||
requestGenerator?(params: any, options: any, client: any, callback: Function): any; | ||
agentKeepAlive?: boolean; | ||
quiet?: boolean; | ||
indexParam?: boolean; | ||
insecure?: boolean; | ||
secureProtocol?: string; | ||
statusCallback?(error: Error, result: any, latency: LoadTestResult): void; | ||
} | ||
export interface LoadTestResult { | ||
totalErrors: number, | ||
totalRequests: number, | ||
totalTimeSeconds: number, | ||
percentiles: { [percentile: number]: number } | ||
rps: number, | ||
meanLatencyMs: number, | ||
minLatencyMs: number, | ||
maxLatencyMs: number, | ||
errors: { [statusCode: string]: number } | ||
} | ||
export interface LoadTestResult { | ||
totalErrors: number, | ||
totalRequests: number, | ||
totalTimeSeconds: number, | ||
percentiles: { [percentile: number]: number } | ||
rps: number, | ||
meanLatencyMs: number, | ||
minLatencyMs: number, | ||
maxLatencyMs: number, | ||
errors: { [statusCode: string]: number } | ||
} | ||
} | ||
export = loadtest; | ||
export as namespace loadtest; | ||
export as namespace loadtest; |
@@ -142,2 +142,14 @@ 'use strict'; | ||
} | ||
var HttpsProxyAgent = require('https-proxy-agent'); | ||
//var proxy = 'http://10.183.16.214:8080'; | ||
// adding proxy configuration | ||
if (this.params.proxy) { | ||
var proxy = this.params.proxy; | ||
//console.log('using proxy server %j', proxy); | ||
var agent = new HttpsProxyAgent(proxy); | ||
this.options.agent = agent; | ||
} | ||
// Disable certificate checking | ||
@@ -144,0 +156,0 @@ if (this.params.insecure === true) { |
@@ -452,7 +452,3 @@ 'use strict'; | ||
let run = 0 | ||
const start = Date.now() | ||
const timer = new HighResolutionTimer(100, () => { | ||
console.log('Run at %s', Date.now() - start) | ||
run++ | ||
}) | ||
const timer = new HighResolutionTimer(100, () => run++) | ||
setTimeout(() => { | ||
@@ -459,0 +455,0 @@ testing.equals(run, 3, callback) |
{ | ||
"name": "loadtest", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"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.", | ||
@@ -22,3 +22,4 @@ "homepage": "https://github.com/alexfernandez/loadtest", | ||
"testing": "^1.1.1", | ||
"websocket": "^1.0.22" | ||
"websocket": "^1.0.22", | ||
"https-proxy-agent": "^2.2.1" | ||
}, | ||
@@ -25,0 +26,0 @@ "devDependencies": { |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
80856
1883
7
7
+ Addedhttps-proxy-agent@^2.2.1
+ Addedagent-base@4.3.0(transitive)
+ Addeddebug@3.2.7(transitive)
+ Addedes6-promise@4.2.8(transitive)
+ Addedes6-promisify@5.0.0(transitive)
+ Addedhttps-proxy-agent@2.2.4(transitive)
+ Addedms@2.1.3(transitive)