Skip to content

PerformanceMonitorConfig

Defined in: sdks/agent/src/middleware/PerformanceMonitor.ts:23

Reporting intervals and callbacks for PerformanceMonitor.

optional criticalThresholdInterval?: number

Defined in: sdks/agent/src/middleware/PerformanceMonitor.ts:27

Threshold in ms for critical warning (default: 10000)


optional healthReportInterval?: number

Defined in: sdks/agent/src/middleware/PerformanceMonitor.ts:25

Interval in ms between health reports (default: 60000). Set to 0 to disable.


optional onCriticalResponse?: (durationMs) => void

Defined in: sdks/agent/src/middleware/PerformanceMonitor.ts:29

Called when a message takes longer than the critical threshold to process. Defaults to logging a warning.

number

void


optional onHealthReport?: (report) => void

Defined in: sdks/agent/src/middleware/PerformanceMonitor.ts:31

Called on each health report interval. Defaults to logging CPU and memory stats.

HealthReport

void


optional onResponse?: (durationMs) => void

Defined in: sdks/agent/src/middleware/PerformanceMonitor.ts:33

Called after every message with the processing duration in ms.

number

void


optional onShutdown?: () => void

Defined in: sdks/agent/src/middleware/PerformanceMonitor.ts:35

Called when shutdown is invoked. Defaults to logging a message.

void