Runtime profiler read surface (provided by the profiler module). 更多...
#include <ProfilerQuery.h>
Public 成员函数 | |
| virtual | ~IProfilerQuery ()=default |
| I profiler query. | |
| virtual bool | enabled () const =0 |
| Whether the profiler is currently collecting zones. | |
| virtual std::string | frameJson () const =0 |
| Last completed frame as compact JSON. | |
| virtual std::string | hotspotsJson (std::size_t limit, double minSelfMs) const =0 |
| Top zones by self time as JSON. | |
| virtual std::string | textReport () const =0 |
| Human-readable per-zone report of the last completed frame. | |
静态 Public 属性 | |
| static constexpr const char * | capabilityName = "IProfilerQuery" |
详细描述
Runtime profiler read surface (provided by the profiler module).
The profiler already aggregates a per-module / per-zone call tree every frame, but only Squirrel and the ImGui panel could read it; an agent had no way to ask "where did this frame go", so unattended performance work fell back to guessing from wall-clock timings. This capability exposes the same read-only view.
Implementations must only read: finalizing a frame is the frame loop's job, so a query never calls the aggregation step.
在文件 ProfilerQuery.h 第 21 行定义.
构造及析构函数说明
◆ ~IProfilerQuery()
|
virtualdefault |
I profiler query.
成员函数说明
◆ enabled()
|
pure virtual |
Whether the profiler is currently collecting zones.
◆ frameJson()
|
pure virtual |
Last completed frame as compact JSON.
Schema eve.profiler.frame version 2: {"schema":…,"version":2,"enabled":…,"hasFrame":…,"cpuFrameMs":…,"gpuMs":…, "gpuTimingAvailable":…,"zoneCount":…, "hotspots":[{"module":…,"name":…,"thread":…,"selfMs":…,"totalMs":…,"count":…,"depth":…}], "zones":[… same shape …]}
hotspots is the top zones by selfMs (default cap 8) for quick agent triage; zones remains the full sorted list. cpuFrameMs is the sum of top-level zone self times: the profiler core aggregates zones and does not own the frame loop's wall-clock duration. hasFrame is false before the first completed frame, and both arrays are empty rather than absent.
◆ hotspotsJson()
|
pure virtual |
Top zones by self time as JSON.
Schema eve.profiler.hotspots version 1: {"schema":…,"version":1,"hasFrame":…,"limit":…,"minSelfMs":…,"count":…, "zones":[{"module":…,"name":…,"thread":…,"selfMs":…,"totalMs":…,"count":…,"depth":…}]}
@cost Linear in last-frame zone count; diagnostic only.
◆ textReport()
|
pure virtual |
Human-readable per-zone report of the last completed frame.
类成员变量说明
◆ capabilityName
|
staticconstexpr |
在文件 ProfilerQuery.h 第 23 行定义.
该类的文档由以下文件生成:
- src/engine/common/ProfilerQuery.h