Skip to content

PerformanceMonitorConfig

Defined in: sdks/js/agent-sdk/src/middleware/PerformanceMonitor.ts:22

Reporting intervals and callbacks for PerformanceMonitor.

optional criticalThresholdInterval?: number

Defined in: sdks/js/agent-sdk/src/middleware/PerformanceMonitor.ts:26

Threshold in ms for critical warning (default: 10000)


optional healthReportInterval?: number

Defined in: sdks/js/agent-sdk/src/middleware/PerformanceMonitor.ts:24

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


optional onCriticalResponse?: (durationMs) => void

Defined in: sdks/js/agent-sdk/src/middleware/PerformanceMonitor.ts:28

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/js/agent-sdk/src/middleware/PerformanceMonitor.ts:30

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

HealthReport

void


optional onResponse?: (durationMs) => void

Defined in: sdks/js/agent-sdk/src/middleware/PerformanceMonitor.ts:32

Called after every message with the processing duration in ms.

number

void


optional onShutdown?: () => void

Defined in: sdks/js/agent-sdk/src/middleware/PerformanceMonitor.ts:34

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

void