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 <string>
5#include <vector>
6#include <memory>
7#include <chrono>
8
10#include "app/gfx/memory_pool.h"
12
13namespace yaze {
14namespace gfx {
15
30
60 public:
61 static PerformanceDashboard& Get();
62
66 void Initialize();
67
71 void Update();
72
76 void Render();
77
81 void SetVisible(bool visible) { visible_ = visible; }
82 bool IsVisible() const { return visible_; }
83
88
92 std::string ExportReport() const;
93
94 private:
97
113
126
131
132 std::chrono::high_resolution_clock::time_point last_update_time_;
133 std::vector<double> frame_time_history_;
134 std::vector<double> memory_usage_history_;
135
136 static constexpr size_t kHistorySize = 100;
137 static constexpr double kUpdateIntervalMs = 100.0; // Update every 100ms
138
139 // UI rendering methods
140 void RenderMetricsPanel() const;
141 void RenderOptimizationStatus() const;
142 void RenderMemoryUsage();
144 void RenderRecommendations() const;
145
146 // Data collection methods
147 void CollectMetrics();
149 void AnalyzePerformance();
150
151 // Helper methods
152 static double CalculateAverage(const std::vector<double>& values);
153 static double CalculatePercentile(const std::vector<double>& values, double percentile);
154 static std::string FormatTime(double time_us);
155 static std::string FormatMemory(size_t bytes);
156 std::string GetOptimizationRecommendation() const;
157};
158
159} // namespace gfx
160} // namespace yaze
161
162#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
Main namespace for the application.
Performance summary for external consumption.
std::vector< std::string > recommendations