UNPKG

loadmill

Version:

A node.js module for running load tests and functional tests on loadmill.com

30 lines (29 loc) 894 B
import * as superagent from 'superagent'; declare type SuperAgentStatic = typeof superagent; declare type AgentOptions = { timeout: number; freeSocketTimeout: number; }; /** * Factory for creating a singleton superagent instance with connection pooling */ declare class SuperagentFactory { instance: SuperAgentStatic | null; private agentOptions; private httpAgent; private httpsAgent; constructor(); /** * Get the singleton superagent instance * @returns {SuperAgentStatic} Configured superagent instance */ getInstance(): SuperAgentStatic; reset(): void; /** * Update agent options and recreate agents * @param {Partial<AgentOptions>} options - New agent options */ updateAgentOptions(options: Partial<AgentOptions>): void; } declare const httpClientFactory: SuperagentFactory; export default httpClientFactory;