lightweight-browser-load-tester
Version:
A lightweight load testing tool using real browsers for streaming applications with DRM support
86 lines • 2.46 kB
TypeScript
import { OpenTelemetryConfiguration, BrowserMetrics, DRMMetrics, NetworkMetrics, ErrorLog, TestSummary } from '../types';
/**
* Exports metrics to OpenTelemetry OTLP endpoint in real-time
* This is a simplified implementation that demonstrates OpenTelemetry integration
*/
export declare class OpenTelemetryExporter {
private config;
private metricBuffer;
private flushTimer?;
private isInitialized;
private isShuttingDown;
constructor(config: OpenTelemetryConfiguration);
/**
* Initialize OpenTelemetry exporter (simplified implementation)
*/
initialize(): Promise<void>;
/**
* Export browser metrics to OpenTelemetry
*/
exportBrowserMetrics(metrics: BrowserMetrics): Promise<void>;
/**
* Export DRM metrics to OpenTelemetry
*/
exportDRMMetrics(metrics: DRMMetrics): Promise<void>;
/**
* Export network metrics to OpenTelemetry
*/
exportNetworkMetrics(metrics: NetworkMetrics[]): Promise<void>;
/**
* Export test summary metrics to OpenTelemetry
*/
exportTestSummary(summary: TestSummary): Promise<void>;
/**
* Export error metrics to OpenTelemetry
*/
exportErrorMetrics(errors: ErrorLog[]): Promise<void>;
/**
* Add metrics to the buffer and trigger flush if batch size is reached
*/
private addMetricsToBuffer;
/**
* Start the periodic flush timer
*/
private startFlushTimer;
/**
* Manually flush all buffered metrics to OpenTelemetry
*/
flush(): Promise<void>;
/**
* Send metrics to OpenTelemetry OTLP endpoint
*/
private sendMetricsToOTLP;
/**
* Convert internal metrics format to OTLP format
*/
private convertToOTLPFormat;
/**
* Convert a single metric to OTLP format
*/
private convertMetricToOTLP;
/**
* Get appropriate unit for metric name
*/
private getMetricUnit;
/**
* Make HTTP request to OpenTelemetry OTLP endpoint
*/
private makeHttpRequest;
/**
* Sleep for specified milliseconds
*/
private sleep;
/**
* Shutdown the exporter and flush remaining metrics
*/
shutdown(): Promise<void>;
/**
* Get configuration for debugging
*/
getConfig(): Readonly<OpenTelemetryConfiguration>;
/**
* Check if the exporter is initialized
*/
isReady(): boolean;
}
//# sourceMappingURL=opentelemetry-exporter.d.ts.map