Raxol. Core. Performance
(Raxol v2.6.0)
View Source
Performance monitoring facade for Raxol.Core.
Provides a simple interface for performance initialization and statistics gathering. This module serves as the entry point for performance monitoring used by the Core module.
For detailed performance analysis, see the modules in Raxol.Performance.*:
Raxol.Performance.Profiler- Detailed profilingRaxol.Performance.MetricsCollector- Metrics collectionRaxol.Performance.Analyzer- Performance analysisRaxol.Performance.JankDetector- Frame timing issues
Summary
Functions
Gets current performance statistics.
Initializes the performance monitoring system.
Records a frame render event.
Resets performance statistics.
Types
@type stats() :: %{ uptime_ms: number(), frame_count: non_neg_integer(), avg_frame_time_ms: float(), fps: float(), memory_mb: float(), samples: non_neg_integer(), initialized: boolean() }
Performance statistics map
Functions
@spec get_stats() :: {:ok, stats()}
Gets current performance statistics.
Returns
{:ok, stats}where stats is a map containing::uptime_ms- Time since initialization in milliseconds:frame_count- Total frames rendered:avg_frame_time_ms- Average frame render time:fps- Estimated frames per second:memory_mb- Current memory usage in MB
@spec init(keyword()) :: :ok
Initializes the performance monitoring system.
Options
:enabled- Whether to enable performance monitoring (default: true):max_samples- Maximum number of samples to keep (default: 100)
Returns
:okon success
@spec record_frame(non_neg_integer()) :: :ok
Records a frame render event.
Parameters
render_time_us- Render time in microseconds
@spec reset() :: :ok
Resets performance statistics.