PerformanceMonitorConfig
Defined in: sdks/agent/src/middleware/PerformanceMonitor.ts:23
Reporting intervals and callbacks for PerformanceMonitor.
Properties
Section titled “Properties”criticalThresholdInterval?
Section titled “criticalThresholdInterval?”
optionalcriticalThresholdInterval?:number
Defined in: sdks/agent/src/middleware/PerformanceMonitor.ts:27
Threshold in ms for critical warning (default: 10000)
healthReportInterval?
Section titled “healthReportInterval?”
optionalhealthReportInterval?:number
Defined in: sdks/agent/src/middleware/PerformanceMonitor.ts:25
Interval in ms between health reports (default: 60000). Set to 0 to disable.
onCriticalResponse?
Section titled “onCriticalResponse?”
optionalonCriticalResponse?: (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.
Parameters
Section titled “Parameters”durationMs
Section titled “durationMs”number
Returns
Section titled “Returns”void
onHealthReport?
Section titled “onHealthReport?”
optionalonHealthReport?: (report) =>void
Defined in: sdks/agent/src/middleware/PerformanceMonitor.ts:31
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/agent/src/middleware/PerformanceMonitor.ts:33
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/agent/src/middleware/PerformanceMonitor.ts:35
Called when shutdown is invoked. Defaults to logging a message.
Returns
Section titled “Returns”void