Adds a lightweight profiling system for measuring latency across the
message processing pipeline.
Features:
- createRequestProfiler() to track timing marks
- Automatic segment calculation between marks
- Log-friendly output format
- Global enable/disable config
Usage example:
const profiler = createRequestProfiler();
profiler.mark('channel_received');
profiler.mark('media_downloaded');
profiler.mark('agent_invoked');
profiler.mark('response_sent');
console.log(profiler.toLogString());
This lays the groundwork for integrating profiling into the main
message dispatch flow to identify latency bottlenecks.
Closes #XXXX