FabricStatistics.kl¶
Interfaces¶
StatisticSource (interface)¶
Interface allowing for recording an object’s statistics. See 統計(Statistics) for more details. It is recommended use the StatisticsAutoRegisterMember helper object as it simplifies the StatisticSource interface support. See 統計(Statistics) for an example of usage.
Functions¶
StatisticRecord[] | getStatistics ? () |
Size | getStatisticsKey ? () |
setStatisticsKey ! ( in Size key ) |
Functions in detail¶
StatisticRecord[] StatisticSource.getStatistics? ()
Returns all the statistics or information related to the StatisticSource (including the Name). The Type will be generated automatically if not provided.
Size StatisticSource.getStatisticsKey? ()
Retrieves the statistic key, for private usage from the FabricStatistic extension. This key should have the same value as the last StatisticSource.setStatisticsKey call.
注釈
See StatisticsAutoRegisterMember for simplifying the support for this interface.
StatisticSource.setStatisticsKey! ( in Size key )
Sets a statistic key, for private usage from the FabricStatistic extension. This key should be stored and the same key should be returned by the StatisticSource.getStatisticsKey function.
注釈
See StatisticsAutoRegisterMember for simplifying the support for this interface.
Types¶
ProfilingEvent (struct)¶
Raw profiling data returned by GetProfilingEvents
Members¶
Size | level | Hierarchy level (root == 0) |
Size | frame | Current frame |
String | label | Profiling event label |
Float64 | startTime | Start time |
Float64 | duration | Elapsed time |
String | sourceName | Profiling event associated Statistics source, if any |
UInt32 | threadIndex | Thread Index for this event. |
Methods¶
ProfilingEvent ( in ProfilingEvent other ) | |
ProfilingEvent () | |
ProfilingEvent | clone ? () |
AutoProfilingEvent (struct)¶
The AutoProfilingEvent helper struct simplifies the recording of a profiling event by automatically calling BeginProfilingEvent in its constructor and EndProfilingEvent in its destructor. This is intended to be created as a local variable, whose scope is the same as the profiled event. See プロファイリング for an example of usage.
Members¶
Size | key |
Methods¶
AutoProfilingEvent ( in AutoProfilingEvent other ) | |
AutoProfilingEvent ( in String label ) | |
AutoProfilingEvent ( in String label, in Ref<StatisticSource> source ) | |
AutoProfilingEvent () | |
AutoProfilingEvent | clone ? () |
Functions¶
FabricStatisticsEnabled¶
Boolean FabricStatisticsEnabled ()
Return true if statistics collection is enabled.
EnableFabricStatistics¶
EnableFabricStatistics ()
Enables statistics collection. Previously constructed StatisticSource objects are ignored. See 統計(Statistics) for an example of usage.
DisableFabricStatistics¶
DisableFabricStatistics ()
Disable statistics collection, and collected data is lost (reset).
RegisterToFabricStatistics¶
RegisterToFabricStatistics ( in Ref<StatisticSource> source )
Registers a statistic source if statistics are enabled.
注釈
When used, the StatisticsAutoRegisterMember helper object takes care of calling this.
AddStatisticsChild¶
AddStatisticsChild ( in Ref<StatisticSource> parent, in Ref<StatisticSource> child )
Declares a parent-child relationship between two statistic sources (hierarchy) See 統計(Statistics) for an example of usage.
UnregisterFromFabricStatistics¶
UnregisterFromFabricStatistics ( in Ref<StatisticSource> source )
Unregisters a statistic source. This must be called before the source gets destroyed.
注釈
When used, the StatisticsAutoRegisterMember helper object takes care of calling this.
GetStatisticsCSV¶
String[] GetStatisticsCSV ( in String columnsToSelect[], in String columnsToSum[] )
Returns the statistics as CSV-formatted lines. The first line contains the column names. The data is provided as a flattened hierarchy (root first), and the first column is the hierarchy level. The second column is the Name.
columnsToSelect | Columns (record names) to gather. If empty, one column will be created for all defined statistic fields. |
columnsTosum | Statistic records that should be summed over the hierarchy. Typically, Memory and GPUMemory can be summed. |
GetStatisticsCSV¶
String[] GetStatisticsCSV ( in String columnsToSelect[], in String columnsToSum[] )
Returns the statistics as CSV-formatted lines. The first line contains the column names. The data is provided as a flattened hierarchy (root first), and the first column is the hierarchy level. The second column is the Name.
columnsToSelect | Columns (record names) to gather. If empty, one column will be created for all defined statistic fields. |
columnsTosum | Statistic records that should be summed over the hierarchy. Typically, Memory and GPUMemory can be summed. |
GetStatisticsCSV¶
String[] GetStatisticsCSV ( in String columnsToSelect[], in String columnsToSum[] )
Returns the statistics as CSV-formatted lines. The first line contains the column names. The data is provided as a flattened hierarchy (root first), and the first column is the hierarchy level. The second column is the Name.
columnsToSelect | Columns (record names) to gather. If empty, one column will be created for all defined statistic fields. |
columnsTosum | Statistic records that should be summed over the hierarchy. Typically, Memory and GPUMemory can be summed. |
GetStatisticStrings¶
GetStatisticStrings ( out String lines[], out Size levels[], in String columnsToSelect[] )
Returns the statistics as String lines and hierarchy levels (flattened hierarchy, root first). The Memory and GPUMemory records will be summed over the hierarchy.
lines | Content of the gathered statistic records, in the format statsName1=value1 statsName2=value2 statsName2=value3 ... . String values will have double-quotes. |
levels | Hierarchy level of the records, in flattened hierarchy order (0 == root, similar to an expanded tree view). |
columnsToSelect | Columns (record names) to gather. If empty, all statistics will be gathered. |
GetStatisticStrings¶
GetStatisticStrings ( out String lines[], out Size levels[], in String columnsToSelect[] )
Returns the statistics as String lines and hierarchy levels (flattened hierarchy, root first). The Memory and GPUMemory records will be summed over the hierarchy.
lines | Content of the gathered statistic records, in the format statsName1=value1 statsName2=value2 statsName2=value3 ... . String values will have double-quotes. |
levels | Hierarchy level of the records, in flattened hierarchy order (0 == root, similar to an expanded tree view). |
columnsToSelect | Columns (record names) to gather. If empty, all statistics will be gathered. |
GetStatisticStrings¶
GetStatisticStrings ( out String lines[], out Size levels[], in String columnsToSelect[] )
Returns the statistics as String lines and hierarchy levels (flattened hierarchy, root first). The Memory and GPUMemory records will be summed over the hierarchy.
lines | Content of the gathered statistic records, in the format statsName1=value1 statsName2=value2 statsName2=value3 ... . String values will have double-quotes. |
levels | Hierarchy level of the records, in flattened hierarchy order (0 == root, similar to an expanded tree view). |
columnsToSelect | Columns (record names) to gather. If empty, all statistics will be gathered. |
GetStatisticsReport¶
String GetStatisticsReport ()
GetStatisticsReport returns a full statistics report as a single String, providing a simple way to dump the results in the console from KL. The Memory and GPUMemory records will be summed over the hierarchy. See 統計(Statistics) for an example of usage.
GetStatisticsReport¶
String GetStatisticsReport ()
GetStatisticsReport returns a full statistics report as a single String, providing a simple way to dump the results in the console from KL. The Memory and GPUMemory records will be summed over the hierarchy. See 統計(Statistics) for an example of usage.
GetStatisticsReport¶
String GetStatisticsReport ()
GetStatisticsReport returns a full statistics report as a single String, providing a simple way to dump the results in the console from KL. The Memory and GPUMemory records will be summed over the hierarchy. See 統計(Statistics) for an example of usage.
FabricProfilingEnabled¶
Boolean FabricProfilingEnabled ()
Returns true if profiling events recording is enabled.
StartFabricProfiling¶
StartFabricProfiling ()
Enables profiling events recording until StopFabricProfiling is called.
StartFabricProfiling¶
StartFabricProfiling ()
Enables profiling events recording until StopFabricProfiling is called.
StartFabricProfilingFrames¶
StartFabricProfilingFrames ( in Size frameCount )
Enables profiling events recording for a certain number of frames.
FabricProfilingBeginFrame¶
FabricProfilingBeginFrame ( in Integer frameID, in Scalar time )
Marks the beginning of a new frame for profiling purposes.
frameID | Frame index (if applicable) |
time | Frame start time (if applicable) |
StopFabricProfiling¶
StopFabricProfiling ()
Stops the profiling events recording. See プロファイリング for an example of usage.
BeginProfilingEvent¶
Size BeginProfilingEvent ( in String label )
Records that a profiling event.
The function returns a key
that is needed for calling the associated EndProfilingEvent.
It is recommended to use the AutoProfilingEvent helper, for simplicity and to minimize error risks.
See プロファイリング for an example of usage.
label | Identifies the profiling event. The FUNC built-in KL constant can be used to identify current function. |
BeginProfilingEvent¶
Size BeginProfilingEvent ( in String label )
Records that a profiling event.
The function returns a key
that is needed for calling the associated EndProfilingEvent.
It is recommended to use the AutoProfilingEvent helper, for simplicity and to minimize error risks.
See プロファイリング for an example of usage.
label | Identifies the profiling event. The FUNC built-in KL constant can be used to identify current function. |
EndProfilingEvent¶
EndProfilingEvent ( in Size key )
Records the end of a profiling event. The key must be the returned value of the associated BeginProfilingEvent call. It is recommended to use the AutoProfilingEvent helper, for simplicity and to minimize error risks.
GetProfilingEvents¶
ProfilingEvent[] GetProfilingEvents ()
Returns all the recorded profiling events. The level member of the ProfilingEvent struct defines event’s level within the flattened hierarchy (root == 0).
注釈
Events are not necessarily ordered by start time.