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
9
#include "
app/gfx/debug/performance/performance_profiler.h
"
10
#include "
app/gfx/render/atlas_renderer.h
"
11
#include "
app/gfx/resource/memory_pool.h
"
12
13
namespace
yaze
{
14
namespace
gfx {
15
19
struct
PerformanceSummary
{
20
double
average_frame_time_ms
;
21
double
memory_usage_mb
;
22
double
cache_hit_ratio
;
23
int
optimization_score
;
// 0-100
24
std::string
status_message
;
25
std::vector<std::string>
recommendations
;
26
27
PerformanceSummary
()
28
:
average_frame_time_ms
(0.0),
29
memory_usage_mb
(0.0),
30
cache_hit_ratio
(0.0),
31
optimization_score
(0) {}
32
};
33
64
class
PerformanceDashboard
{
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
92
PerformanceSummary
GetSummary
()
const
;
93
97
std::string
ExportReport
()
const
;
98
99
private
:
100
PerformanceDashboard
() =
default
;
101
~PerformanceDashboard
() =
default
;
102
103
struct
PerformanceMetrics
{
104
double
frame_time_ms
;
105
double
palette_lookup_time_us
;
106
double
texture_update_time_us
;
107
double
batch_operation_time_us
;
108
double
memory_usage_mb
;
109
double
cache_hit_ratio
;
110
int
draw_calls_per_frame
;
111
int
texture_updates_per_frame
;
112
113
PerformanceMetrics
()
114
:
frame_time_ms
(0.0),
115
palette_lookup_time_us
(0.0),
116
texture_update_time_us
(0.0),
117
batch_operation_time_us
(0.0),
118
memory_usage_mb
(0.0),
119
cache_hit_ratio
(0.0),
120
draw_calls_per_frame
(0),
121
texture_updates_per_frame
(0) {}
122
};
123
124
struct
OptimizationStatus
{
125
bool
palette_lookup_optimized
;
126
bool
dirty_region_tracking_enabled
;
127
bool
resource_pooling_active
;
128
bool
batch_operations_enabled
;
129
bool
atlas_rendering_enabled
;
130
bool
memory_pool_active
;
131
132
OptimizationStatus
()
133
:
palette_lookup_optimized
(false),
134
dirty_region_tracking_enabled
(false),
135
resource_pooling_active
(false),
136
batch_operations_enabled
(false),
137
atlas_rendering_enabled
(false),
138
memory_pool_active
(false) {}
139
};
140
141
bool
visible_
;
142
PerformanceMetrics
current_metrics_
;
143
PerformanceMetrics
previous_metrics_
;
144
OptimizationStatus
optimization_status_
;
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
();
157
void
RenderFrameRateGraph
();
158
void
RenderRecommendations
()
const
;
159
160
// Data collection methods
161
void
CollectMetrics
();
162
void
UpdateOptimizationStatus
();
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
atlas_renderer.h
yaze::gfx::PerformanceDashboard
Comprehensive performance monitoring dashboard for YAZE graphics system.
Definition
performance_dashboard.h:64
yaze::gfx::PerformanceDashboard::Get
static PerformanceDashboard & Get()
Definition
performance_dashboard.cc:15
yaze::gfx::PerformanceDashboard::UpdateOptimizationStatus
void UpdateOptimizationStatus()
Definition
performance_dashboard.cc:430
yaze::gfx::PerformanceDashboard::RenderRecommendations
void RenderRecommendations() const
Definition
performance_dashboard.cc:313
yaze::gfx::PerformanceDashboard::IsVisible
bool IsVisible() const
Definition
performance_dashboard.h:87
yaze::gfx::PerformanceDashboard::SetVisible
void SetVisible(bool visible)
Show/hide the dashboard.
Definition
performance_dashboard.h:86
yaze::gfx::PerformanceDashboard::current_metrics_
PerformanceMetrics current_metrics_
Definition
performance_dashboard.h:142
yaze::gfx::PerformanceDashboard::visible_
bool visible_
Definition
performance_dashboard.h:141
yaze::gfx::PerformanceDashboard::PerformanceDashboard
PerformanceDashboard()=default
yaze::gfx::PerformanceDashboard::FormatTime
static std::string FormatTime(double time_us)
Definition
performance_dashboard.cc:504
yaze::gfx::PerformanceDashboard::optimization_status_
OptimizationStatus optimization_status_
Definition
performance_dashboard.h:144
yaze::gfx::PerformanceDashboard::CalculatePercentile
static double CalculatePercentile(const std::vector< double > &values, double percentile)
Definition
performance_dashboard.cc:487
yaze::gfx::PerformanceDashboard::memory_usage_history_
std::vector< double > memory_usage_history_
Definition
performance_dashboard.h:148
yaze::gfx::PerformanceDashboard::AnalyzePerformance
void AnalyzePerformance()
Definition
performance_dashboard.cc:462
yaze::gfx::PerformanceDashboard::GetSummary
PerformanceSummary GetSummary() const
Get current performance summary.
Definition
performance_dashboard.cc:60
yaze::gfx::PerformanceDashboard::RenderMemoryUsage
void RenderMemoryUsage()
Definition
performance_dashboard.cc:242
yaze::gfx::PerformanceDashboard::Update
void Update()
Update dashboard with current performance data.
Definition
performance_dashboard.cc:27
yaze::gfx::PerformanceDashboard::FormatMemory
static std::string FormatMemory(size_t bytes)
Definition
performance_dashboard.cc:514
yaze::gfx::PerformanceDashboard::CalculateAverage
static double CalculateAverage(const std::vector< double > &values)
Definition
performance_dashboard.cc:475
yaze::gfx::PerformanceDashboard::last_update_time_
std::chrono::high_resolution_clock::time_point last_update_time_
Definition
performance_dashboard.h:146
yaze::gfx::PerformanceDashboard::previous_metrics_
PerformanceMetrics previous_metrics_
Definition
performance_dashboard.h:143
yaze::gfx::PerformanceDashboard::RenderMetricsPanel
void RenderMetricsPanel() const
Definition
performance_dashboard.cc:177
yaze::gfx::PerformanceDashboard::kUpdateIntervalMs
static constexpr double kUpdateIntervalMs
Definition
performance_dashboard.h:151
yaze::gfx::PerformanceDashboard::Initialize
void Initialize()
Initialize the performance dashboard.
Definition
performance_dashboard.cc:20
yaze::gfx::PerformanceDashboard::CollectMetrics
void CollectMetrics()
Definition
performance_dashboard.cc:353
yaze::gfx::PerformanceDashboard::Render
void Render()
Render the performance dashboard UI.
Definition
performance_dashboard.cc:40
yaze::gfx::PerformanceDashboard::frame_time_history_
std::vector< double > frame_time_history_
Definition
performance_dashboard.h:147
yaze::gfx::PerformanceDashboard::RenderOptimizationStatus
void RenderOptimizationStatus() const
Definition
performance_dashboard.cc:202
yaze::gfx::PerformanceDashboard::RenderFrameRateGraph
void RenderFrameRateGraph()
Definition
performance_dashboard.cc:281
yaze::gfx::PerformanceDashboard::kHistorySize
static constexpr size_t kHistorySize
Definition
performance_dashboard.h:150
yaze::gfx::PerformanceDashboard::ExportReport
std::string ExportReport() const
Export performance report.
Definition
performance_dashboard.cc:118
yaze::gfx::PerformanceDashboard::GetOptimizationRecommendation
std::string GetOptimizationRecommendation() const
Definition
performance_dashboard.cc:524
yaze::gfx::PerformanceDashboard::~PerformanceDashboard
~PerformanceDashboard()=default
memory_pool.h
yaze
Definition
application.cc:18
performance_profiler.h
yaze::gfx::PerformanceDashboard::OptimizationStatus
Definition
performance_dashboard.h:124
yaze::gfx::PerformanceDashboard::OptimizationStatus::batch_operations_enabled
bool batch_operations_enabled
Definition
performance_dashboard.h:128
yaze::gfx::PerformanceDashboard::OptimizationStatus::atlas_rendering_enabled
bool atlas_rendering_enabled
Definition
performance_dashboard.h:129
yaze::gfx::PerformanceDashboard::OptimizationStatus::memory_pool_active
bool memory_pool_active
Definition
performance_dashboard.h:130
yaze::gfx::PerformanceDashboard::OptimizationStatus::OptimizationStatus
OptimizationStatus()
Definition
performance_dashboard.h:132
yaze::gfx::PerformanceDashboard::OptimizationStatus::palette_lookup_optimized
bool palette_lookup_optimized
Definition
performance_dashboard.h:125
yaze::gfx::PerformanceDashboard::OptimizationStatus::resource_pooling_active
bool resource_pooling_active
Definition
performance_dashboard.h:127
yaze::gfx::PerformanceDashboard::OptimizationStatus::dirty_region_tracking_enabled
bool dirty_region_tracking_enabled
Definition
performance_dashboard.h:126
yaze::gfx::PerformanceDashboard::PerformanceMetrics
Definition
performance_dashboard.h:103
yaze::gfx::PerformanceDashboard::PerformanceMetrics::texture_update_time_us
double texture_update_time_us
Definition
performance_dashboard.h:106
yaze::gfx::PerformanceDashboard::PerformanceMetrics::PerformanceMetrics
PerformanceMetrics()
Definition
performance_dashboard.h:113
yaze::gfx::PerformanceDashboard::PerformanceMetrics::draw_calls_per_frame
int draw_calls_per_frame
Definition
performance_dashboard.h:110
yaze::gfx::PerformanceDashboard::PerformanceMetrics::memory_usage_mb
double memory_usage_mb
Definition
performance_dashboard.h:108
yaze::gfx::PerformanceDashboard::PerformanceMetrics::cache_hit_ratio
double cache_hit_ratio
Definition
performance_dashboard.h:109
yaze::gfx::PerformanceDashboard::PerformanceMetrics::texture_updates_per_frame
int texture_updates_per_frame
Definition
performance_dashboard.h:111
yaze::gfx::PerformanceDashboard::PerformanceMetrics::batch_operation_time_us
double batch_operation_time_us
Definition
performance_dashboard.h:107
yaze::gfx::PerformanceDashboard::PerformanceMetrics::frame_time_ms
double frame_time_ms
Definition
performance_dashboard.h:104
yaze::gfx::PerformanceDashboard::PerformanceMetrics::palette_lookup_time_us
double palette_lookup_time_us
Definition
performance_dashboard.h:105
yaze::gfx::PerformanceSummary
Performance summary for external consumption.
Definition
performance_dashboard.h:19
yaze::gfx::PerformanceSummary::status_message
std::string status_message
Definition
performance_dashboard.h:24
yaze::gfx::PerformanceSummary::recommendations
std::vector< std::string > recommendations
Definition
performance_dashboard.h:25
yaze::gfx::PerformanceSummary::cache_hit_ratio
double cache_hit_ratio
Definition
performance_dashboard.h:22
yaze::gfx::PerformanceSummary::PerformanceSummary
PerformanceSummary()
Definition
performance_dashboard.h:27
yaze::gfx::PerformanceSummary::average_frame_time_ms
double average_frame_time_ms
Definition
performance_dashboard.h:20
yaze::gfx::PerformanceSummary::optimization_score
int optimization_score
Definition
performance_dashboard.h:23
yaze::gfx::PerformanceSummary::memory_usage_mb
double memory_usage_mb
Definition
performance_dashboard.h:21
src
app
gfx
debug
performance
performance_dashboard.h
Generated by
1.10.0