yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
performance_dashboard.h
Go to the documentation of this file.
1#ifndef YAZE_APP_GFX_PERFORMANCE_PERFORMANCE_DASHBOARD_H
2#define YAZE_APP_GFX_PERFORMANCE_PERFORMANCE_DASHBOARD_H
3
4#include <chrono>
5#include <memory>
6#include <string>
7#include <vector>
8
12
13namespace yaze {
14namespace gfx {
15
33
65 public:
66 static PerformanceDashboard& Get();
67
71 void Initialize();
72
76 void Update();
77
81 void Render();
82
86 void SetVisible(bool visible) { visible_ = visible; }
87 bool IsVisible() const { return visible_; }
88
93
97 std::string ExportReport() const;
98
99 private:
102
123
140
145
146 std::chrono::high_resolution_clock::time_point last_update_time_;
147 std::vector<double> frame_time_history_;
148 std::vector<double> memory_usage_history_;
149
150 static constexpr size_t kHistorySize = 100;
151 static constexpr double kUpdateIntervalMs = 100.0; // Update every 100ms
152
153 // UI rendering methods
154 void RenderMetricsPanel() const;
155 void RenderOptimizationStatus() const;
156 void RenderMemoryUsage();
158 void RenderRecommendations() const;
159
160 // Data collection methods
161 void CollectMetrics();
163 void AnalyzePerformance();
164
165 // Helper methods
166 static double CalculateAverage(const std::vector<double>& values);
167 static double CalculatePercentile(const std::vector<double>& values,
168 double percentile);
169 static std::string FormatTime(double time_us);
170 static std::string FormatMemory(size_t bytes);
171 std::string GetOptimizationRecommendation() const;
172};
173
174} // namespace gfx
175} // namespace yaze
176
177#endif // YAZE_APP_GFX_PERFORMANCE_PERFORMANCE_DASHBOARD_H
Comprehensive performance monitoring dashboard for YAZE graphics system.
static PerformanceDashboard & Get()
void SetVisible(bool visible)
Show/hide the dashboard.
static std::string FormatTime(double time_us)
static double CalculatePercentile(const std::vector< double > &values, double percentile)
std::vector< double > memory_usage_history_
PerformanceSummary GetSummary() const
Get current performance summary.
void Update()
Update dashboard with current performance data.
static std::string FormatMemory(size_t bytes)
static double CalculateAverage(const std::vector< double > &values)
std::chrono::high_resolution_clock::time_point last_update_time_
static constexpr double kUpdateIntervalMs
void Initialize()
Initialize the performance dashboard.
void Render()
Render the performance dashboard UI.
std::string ExportReport() const
Export performance report.
std::string GetOptimizationRecommendation() const
Performance summary for external consumption.
std::vector< std::string > recommendations