Raxol.Core.Performance (Raxol v2.0.1)
View SourceCore performance module for Raxol framework.
This module provides basic performance monitoring and statistics functionality with pure functional error handling patterns.
Summary
Functions
Gets performance analysis results.
Gets current performance statistics.
Initializes the performance monitoring system.
Records a performance measurement.
Functions
Gets performance analysis results.
Returns
{:ok, analysis}- Performance analysis results{:error, reason}- Failed to get analysis
@spec get_stats() :: {:ok, map()}
Gets current performance statistics.
Returns
{:ok, stats}- Performance statistics map{:error, reason}- Failed to get performance stats
Example
{:ok, stats} = Raxol.Core.Performance.get_stats()
# Returns: {:ok, %{cpu_usage: 15.2, memory_usage: 45.8, render_time: 120}}
Initializes the performance monitoring system.
Parameters
options- Configuration options for performance monitoring (optional)
Returns
:ok- Performance system initialized successfully{:error, reason}- Failed to initialize performance system
Records a performance measurement.
Parameters
name- Measurement namevalue- Measurement value (typically time in milliseconds)tags- Optional tags as keyword list
Returns
:ok- Measurement recorded successfully{:error, reason}- Failed to record measurement