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
9
#include "
app/gfx/performance/performance_profiler.h
"
10
#include "
app/gfx/memory_pool.h
"
11
#include "
app/gfx/atlas_renderer.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
() :
average_frame_time_ms
(0.0),
memory_usage_mb
(0.0),
28
cache_hit_ratio
(0.0),
optimization_score
(0) {}
29
};
30
59
class
PerformanceDashboard
{
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
87
PerformanceSummary
GetSummary
()
const
;
88
92
std::string
ExportReport
()
const
;
93
94
private
:
95
PerformanceDashboard
() =
default
;
96
~PerformanceDashboard
() =
default
;
97
98
struct
PerformanceMetrics
{
99
double
frame_time_ms
;
100
double
palette_lookup_time_us
;
101
double
texture_update_time_us
;
102
double
batch_operation_time_us
;
103
double
memory_usage_mb
;
104
double
cache_hit_ratio
;
105
int
draw_calls_per_frame
;
106
int
texture_updates_per_frame
;
107
108
PerformanceMetrics
() :
frame_time_ms
(0.0),
palette_lookup_time_us
(0.0),
109
texture_update_time_us
(0.0),
batch_operation_time_us
(0.0),
110
memory_usage_mb
(0.0),
cache_hit_ratio
(0.0),
111
draw_calls_per_frame
(0),
texture_updates_per_frame
(0) {}
112
};
113
114
struct
OptimizationStatus
{
115
bool
palette_lookup_optimized
;
116
bool
dirty_region_tracking_enabled
;
117
bool
resource_pooling_active
;
118
bool
batch_operations_enabled
;
119
bool
atlas_rendering_enabled
;
120
bool
memory_pool_active
;
121
122
OptimizationStatus
() :
palette_lookup_optimized
(false),
dirty_region_tracking_enabled
(false),
123
resource_pooling_active
(false),
batch_operations_enabled
(false),
124
atlas_rendering_enabled
(false),
memory_pool_active
(false) {}
125
};
126
127
bool
visible_
;
128
PerformanceMetrics
current_metrics_
;
129
PerformanceMetrics
previous_metrics_
;
130
OptimizationStatus
optimization_status_
;
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
();
143
void
RenderFrameRateGraph
();
144
void
RenderRecommendations
()
const
;
145
146
// Data collection methods
147
void
CollectMetrics
();
148
void
UpdateOptimizationStatus
();
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
atlas_renderer.h
yaze::gfx::PerformanceDashboard
Comprehensive performance monitoring dashboard for YAZE graphics system.
Definition
performance_dashboard.h:59
yaze::gfx::PerformanceDashboard::Get
static PerformanceDashboard & Get()
Definition
performance_dashboard.cc:15
yaze::gfx::PerformanceDashboard::UpdateOptimizationStatus
void UpdateOptimizationStatus()
Definition
performance_dashboard.cc:427
yaze::gfx::PerformanceDashboard::RenderRecommendations
void RenderRecommendations() const
Definition
performance_dashboard.cc:310
yaze::gfx::PerformanceDashboard::IsVisible
bool IsVisible() const
Definition
performance_dashboard.h:82
yaze::gfx::PerformanceDashboard::SetVisible
void SetVisible(bool visible)
Show/hide the dashboard.
Definition
performance_dashboard.h:81
yaze::gfx::PerformanceDashboard::current_metrics_
PerformanceMetrics current_metrics_
Definition
performance_dashboard.h:128
yaze::gfx::PerformanceDashboard::visible_
bool visible_
Definition
performance_dashboard.h:127
yaze::gfx::PerformanceDashboard::PerformanceDashboard
PerformanceDashboard()=default
yaze::gfx::PerformanceDashboard::FormatTime
static std::string FormatTime(double time_us)
Definition
performance_dashboard.cc:500
yaze::gfx::PerformanceDashboard::optimization_status_
OptimizationStatus optimization_status_
Definition
performance_dashboard.h:130
yaze::gfx::PerformanceDashboard::CalculatePercentile
static double CalculatePercentile(const std::vector< double > &values, double percentile)
Definition
performance_dashboard.cc:483
yaze::gfx::PerformanceDashboard::memory_usage_history_
std::vector< double > memory_usage_history_
Definition
performance_dashboard.h:134
yaze::gfx::PerformanceDashboard::AnalyzePerformance
void AnalyzePerformance()
Definition
performance_dashboard.cc:458
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:510
yaze::gfx::PerformanceDashboard::CalculateAverage
static double CalculateAverage(const std::vector< double > &values)
Definition
performance_dashboard.cc:471
yaze::gfx::PerformanceDashboard::last_update_time_
std::chrono::high_resolution_clock::time_point last_update_time_
Definition
performance_dashboard.h:132
yaze::gfx::PerformanceDashboard::previous_metrics_
PerformanceMetrics previous_metrics_
Definition
performance_dashboard.h:129
yaze::gfx::PerformanceDashboard::RenderMetricsPanel
void RenderMetricsPanel() const
Definition
performance_dashboard.cc:177
yaze::gfx::PerformanceDashboard::kUpdateIntervalMs
static constexpr double kUpdateIntervalMs
Definition
performance_dashboard.h:137
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:350
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:133
yaze::gfx::PerformanceDashboard::RenderOptimizationStatus
void RenderOptimizationStatus() const
Definition
performance_dashboard.cc:202
yaze::gfx::PerformanceDashboard::RenderFrameRateGraph
void RenderFrameRateGraph()
Definition
performance_dashboard.cc:278
yaze::gfx::PerformanceDashboard::kHistorySize
static constexpr size_t kHistorySize
Definition
performance_dashboard.h:136
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:520
yaze::gfx::PerformanceDashboard::~PerformanceDashboard
~PerformanceDashboard()=default
memory_pool.h
yaze
Main namespace for the application.
Definition
asar_wrapper.cc:14
performance_profiler.h
yaze::gfx::PerformanceDashboard::OptimizationStatus
Definition
performance_dashboard.h:114
yaze::gfx::PerformanceDashboard::OptimizationStatus::batch_operations_enabled
bool batch_operations_enabled
Definition
performance_dashboard.h:118
yaze::gfx::PerformanceDashboard::OptimizationStatus::atlas_rendering_enabled
bool atlas_rendering_enabled
Definition
performance_dashboard.h:119
yaze::gfx::PerformanceDashboard::OptimizationStatus::memory_pool_active
bool memory_pool_active
Definition
performance_dashboard.h:120
yaze::gfx::PerformanceDashboard::OptimizationStatus::OptimizationStatus
OptimizationStatus()
Definition
performance_dashboard.h:122
yaze::gfx::PerformanceDashboard::OptimizationStatus::palette_lookup_optimized
bool palette_lookup_optimized
Definition
performance_dashboard.h:115
yaze::gfx::PerformanceDashboard::OptimizationStatus::resource_pooling_active
bool resource_pooling_active
Definition
performance_dashboard.h:117
yaze::gfx::PerformanceDashboard::OptimizationStatus::dirty_region_tracking_enabled
bool dirty_region_tracking_enabled
Definition
performance_dashboard.h:116
yaze::gfx::PerformanceDashboard::PerformanceMetrics
Definition
performance_dashboard.h:98
yaze::gfx::PerformanceDashboard::PerformanceMetrics::texture_update_time_us
double texture_update_time_us
Definition
performance_dashboard.h:101
yaze::gfx::PerformanceDashboard::PerformanceMetrics::PerformanceMetrics
PerformanceMetrics()
Definition
performance_dashboard.h:108
yaze::gfx::PerformanceDashboard::PerformanceMetrics::draw_calls_per_frame
int draw_calls_per_frame
Definition
performance_dashboard.h:105
yaze::gfx::PerformanceDashboard::PerformanceMetrics::memory_usage_mb
double memory_usage_mb
Definition
performance_dashboard.h:103
yaze::gfx::PerformanceDashboard::PerformanceMetrics::cache_hit_ratio
double cache_hit_ratio
Definition
performance_dashboard.h:104
yaze::gfx::PerformanceDashboard::PerformanceMetrics::texture_updates_per_frame
int texture_updates_per_frame
Definition
performance_dashboard.h:106
yaze::gfx::PerformanceDashboard::PerformanceMetrics::batch_operation_time_us
double batch_operation_time_us
Definition
performance_dashboard.h:102
yaze::gfx::PerformanceDashboard::PerformanceMetrics::frame_time_ms
double frame_time_ms
Definition
performance_dashboard.h:99
yaze::gfx::PerformanceDashboard::PerformanceMetrics::palette_lookup_time_us
double palette_lookup_time_us
Definition
performance_dashboard.h:100
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
performance
performance_dashboard.h
Generated by
1.9.8