载入中...
搜索中...
未找到
ProfilerModel.cpp
浏览该文件的文档.
25 !finiteNonNegative(budgets.zoneSelfMs) || budgets.historyFrames < 2 || budgets.historyFrames > 36000) {
26 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.profiler.invalid-budgets"),
35 if (frame.sequence == 0 || !finiteNonNegative(frame.cpuFrameMs) || !finiteNonNegative(frame.gpuFrameMs) ||
37 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.profiler.invalid-frame"),
45 if (zone.module.empty() || zone.name.empty() || zone.thread.empty() || !finiteNonNegative(zone.selfMs) ||
46 !finiteNonNegative(zone.totalMs) || zone.selfMs > zone.totalMs || zone.count < 1 || zone.depth < 0) {
47 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.profiler.invalid-zone"),
58std::vector<EditorProfilerZone> EditorProfilerModel::query(const EditorProfilerQuery& options) const {
115 if (frame.gpuTimingAvailable && budgets_.gpuFrameMs > 0.0 && frame.gpuFrameMs > budgets_.gpuFrameMs) {
138Result<void> EditorProfilerCollector::collect(const profiler::Profiler& profiler, EditorProfilerModel& model) const {
143 diagnostics.push_back(eve::editing::ruleDiagnostic(diagnostic.code(), RuleId("editor.profiler.capture"),
157 frame.zones.push_back({std::move(zone.module), std::move(zone.name), std::move(zone.thread), zone.selfMs,
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:313
Script-facing wrapper around the engine-wide profiler core (eve::prof, see common/Profile....
Definition Profiler.h:68
eve::Result< ProfilerFrameSnapshot > captureFrame() const
Copy the latest completed frame for editor and diagnostics consumers.
Definition Profiler.cpp:114
Result< void > collect(const profiler::Profiler &profiler, EditorProfilerModel &model) const
Copy and ingest the latest runtime frame.
Definition ProfilerModel.cpp:138
Bounded owning profiler history and deterministic presentation queries. @thread Main-thread only....
Definition ProfilerModel.h:79
EditorProfilerModel()
Construct with default budgets and a 300-frame history.
Result< void > configure(EditorProfilerBudgets budgets)
Validate and atomically replace editor-only performance budgets.
Definition ProfilerModel.cpp:23
EditorProfilerBudgets budgets() const
Return the current editor-only budgets by value.
Definition ProfilerModel.h:102
std::vector< EditorProfilerZone > query(const EditorProfilerQuery &query) const
Query and sort copied hotspot rows from the latest frame.
Definition ProfilerModel.cpp:58
std::vector< EditorDiagnostic > diagnostics() const
Produce CPU/GPU/zone budget diagnostics for the latest frame.
Definition ProfilerModel.cpp:106
void clear()
Clear retained frames without changing configured budgets.
Definition ProfilerModel.cpp:56
Result< void > ingest(EditorProfilerFrame frame)
Append an owning completed-frame snapshot.
Definition ProfilerModel.cpp:34
std::vector< EditorProfilerModuleSummary > moduleSummary() const
Aggregate copied rows by module for the latest frame.
Definition ProfilerModel.cpp:84
Diagnostic ruleDiagnostic(eve::DiagnosticCode code, RuleId rule, DiagnosticSeverity severity, std::string message)
Build an owning common diagnostic carrying an open editing rule identity.
Definition EditingResult.cpp:20
Definition ProfilerModel.cpp:10
@ PreconditionViolation
@ NotFound
Configurable performance budgets used only for editor diagnostics.
Definition ProfilerModel.h:66
double cpuFrameMs
Definition ProfilerModel.h:67
double zoneSelfMs
Definition ProfilerModel.h:69
double gpuFrameMs
Definition ProfilerModel.h:68
std::size_t historyFrames
Definition ProfilerModel.h:70
One owning completed-frame sample retained by the editor.
Definition ProfilerModel.h:35
std::uint64_t sequence
Definition ProfilerModel.h:36
Non-persistent query applied to the latest profiler frame.
Definition ProfilerModel.h:47
One owning profiler hotspot row projected for editor presentation.
Definition ProfilerModel.h:24