Expand description
Performance and Resource Profiling
Provides global tracking for:
- Total execution time
- Kernel load time
- Plugin discovery/load time
- HTTP network overhead (request count, retry count, total duration)
- Memory consumption at report time (snapshot, not peak)
Structs§
- Profiler
- Global Profiler state.
Functions§
- enable
- Enable profiling output.
- init
- Initialize the global profiler. Must be called as early as possible.
- is_
enabled - Check if profiling is enabled.
- mark_
kernel_ loaded - Record the time taken to load the kernel/CLI base (called at most once).
- mark_
plugins_ loaded - Record the time it took to discover and load plugins (called at most once).
- record_
http_ request - Record a completed HTTP request with its total network duration. Called once per logical request (after all retries are exhausted).
- record_
http_ retry - Record that a retry attempt occurred (called per retry, not per request).
- report
- Print the profiling report if profiling is enabled. Accepts an optional command name and exit code for structured log context.