@push.rocks/smartproxy
Version:
A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.
40 lines (39 loc) • 1.27 kB
TypeScript
/**
* Log deduplication utility to reduce log spam for repetitive events
*/
export declare class LogDeduplicator {
private globalFlushTimer?;
private aggregatedEvents;
private flushInterval;
private maxBatchSize;
private rapidEventThreshold;
private lastRapidCheck;
constructor(flushInterval?: number);
/**
* Log a deduplicated event
* @param key - Aggregation key (e.g., 'connection-rejected', 'cleanup-batch')
* @param level - Log level
* @param message - Log message template
* @param data - Additional data
* @param dedupeKey - Deduplication key within the aggregation (e.g., IP address, reason)
*/
log(key: string, level: 'info' | 'warn' | 'error' | 'debug', message: string, data?: any, dedupeKey?: string): void;
/**
* Flush aggregated events for a specific key
*/
flush(key: string): void;
/**
* Flush all pending events
*/
flushAll(): void;
private flushConnectionRejections;
private flushConnectionCleanups;
private flushConnectionTerminations;
private flushIPRejections;
private flushGeneric;
/**
* Cleanup and stop deduplication
*/
cleanup(): void;
}
export declare const connectionLogDeduplicator: LogDeduplicator;