PerformanceMonitorConfig
Defined in: sdks/js/agent-sdk/src/middleware/PerformanceMonitor.ts:22
Reporting intervals and callbacks for PerformanceMonitor.
Properties
Section titled “Properties”criticalThresholdInterval?
Section titled “criticalThresholdInterval?”
optionalcriticalThresholdInterval?:number
Defined in: sdks/js/agent-sdk/src/middleware/PerformanceMonitor.ts:26
Threshold in ms for critical warning (default: 10000)
healthReportInterval?
Section titled “healthReportInterval?”
optionalhealthReportInterval?: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.
onCriticalResponse?
Section titled “onCriticalResponse?”
optionalonCriticalResponse?: (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.
Parameters
Section titled “Parameters”durationMs
Section titled “durationMs”number
Returns
Section titled “Returns”void
onHealthReport?
Section titled “onHealthReport?”
optionalonHealthReport?: (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.
Parameters
Section titled “Parameters”report
Section titled “report”Returns
Section titled “Returns”void
onResponse?
Section titled “onResponse?”
optionalonResponse?: (durationMs) =>void
Defined in: sdks/js/agent-sdk/src/middleware/PerformanceMonitor.ts:32
Called after every message with the processing duration in ms.
Parameters
Section titled “Parameters”durationMs
Section titled “durationMs”number
Returns
Section titled “Returns”void
onShutdown?
Section titled “onShutdown?”
optionalonShutdown?: () =>void
Defined in: sdks/js/agent-sdk/src/middleware/PerformanceMonitor.ts:34
Called when shutdown is invoked. Defaults to logging a message.
Returns
Section titled “Returns”void

