载入中...
搜索中...
未找到
ProfilerModel.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
6
7#include <cstddef>
8#include <cstdint>
9#include <deque>
10#include <string>
11#include <vector>
12
13namespace eve::profiler {
14class Profiler;
16} // namespace eve::profiler
17
18namespace eve::profiler_editing {
22
25 std::string module;
26 std::string name;
27 std::string thread;
28 double selfMs = 0.0;
29 double totalMs = 0.0;
30 int count = 0;
31 int depth = 0;
32};
33
36 std::uint64_t sequence = 0;
37 double cpuFrameMs = 0.0;
38 double gpuFrameMs = 0.0;
39 bool gpuTimingAvailable = false;
40 std::vector<EditorProfilerZone> zones;
41};
42
45
48 std::string module;
49 std::string thread;
50 std::string text;
52 bool descending = true;
53 std::size_t limit = 500;
54};
55
58 std::string module;
59 double selfMs = 0.0;
60 double totalMs = 0.0;
61 int count = 0;
62 int zones = 0;
63};
64
67 double cpuFrameMs = 16.667;
68 double gpuFrameMs = 16.667;
69 double zoneSelfMs = 4.0;
70 std::size_t historyFrames = 300;
71};
72
80public:
83
89 [[nodiscard]] Result<void> configure(EditorProfilerBudgets budgets);
90
96 [[nodiscard]] Result<void> ingest(EditorProfilerFrame frame);
97
99 void clear();
100
102 EditorProfilerBudgets budgets() const { return budgets_; }
103
105 const std::deque<EditorProfilerFrame>& history() const { return history_; }
106
108 std::vector<EditorProfilerZone> query(const EditorProfilerQuery& query) const;
109
111 std::vector<EditorProfilerModuleSummary> moduleSummary() const;
112
114 std::vector<EditorDiagnostic> diagnostics() const;
115
116private:
117 EditorProfilerBudgets budgets_;
118 std::deque<EditorProfilerFrame> history_;
119};
120
127public:
134 [[nodiscard]] Result<void> collect(const profiler::Profiler& profiler,
136};
137
138} // namespace eve::profiler_editing
#define EVENGINE_API_BACKENDS
Definition Export.h:108
glm::mat4 model
A structured explanation of a failed, degraded, or noteworthy result.
Definition Diagnostic.h:94
Move-only operation result carrying either a value or Status.
Definition Result.h:155
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:314
Script-facing wrapper around the engine-wide profiler core (eve::prof, see common/Profile....
Definition Profiler.h:67
Optional profiler-module bridge that copies one completed runtime frame. @thread Main-thread only,...
Result< void > collect(const profiler::Profiler &profiler, EditorProfilerModel &model) const
Copy and ingest the latest runtime frame.
Bounded owning profiler history and deterministic presentation queries. @thread Main-thread only....
EditorProfilerModel()
Construct with default budgets and a 300-frame history.
const std::deque< EditorProfilerFrame > & history() const
Return the bounded owning frame history.
EditorProfilerBudgets budgets() const
Return the current editor-only budgets by value.
eve::Severity DiagnosticSeverity
eve::Diagnostic Diagnostic
StrongId< RuleIdTag > RuleId
Definition EditingIds.h:60
eve::StatusCode Status
EditorProfilerSort
Sort key used by the profiler hotspot table.
StatusCode
Stable outcome category for an operation.
Definition Status.h:27
Severity
Stable severity of a diagnostic, independent of its display text.
Definition Diagnostic.h:20
Owning CPU/GPU profiler snapshot safe to retain across later frames.
Definition Profiler.h:36
Configurable performance budgets used only for editor diagnostics.
One owning completed-frame sample retained by the editor.
std::vector< EditorProfilerZone > zones
Aggregated module timing for the latest completed frame.
Non-persistent query applied to the latest profiler frame.
One owning profiler hotspot row projected for editor presentation.