Skip to main content

Module profiler

Module profiler 

Source
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.