Data Structures | |
| class | EnProfiler |
| Set of methods for accessing script profiling data. More... | |
Typedefs | |
| typedef Param2< float, typename > | EnProfilerTimeClassPair |
| typedef Param2< int, typename > | EnProfilerCountClassPair |
| typedef Param2< float, string > | EnProfilerTimeFuncPair |
| typedef Param2< int, string > | EnProfilerCountFuncPair |
Enumerations | |
| enum | EnProfilerFlags { NONE = -1 , RESET , RECURSIVE , ALL } |
| Flags that influences the behaviour of the EnProfiler API, applied through ...Flags functions. More... | |
| enum | EnProfilerModule { CORE , GAMELIB , GAME , WORLD , MISSION , MISSION_CUSTOM , ERROR } |
| Current base scripted modules. More... | |
| enum | EnProfilerEnabledFlags { NONE = -1 , DIAG , SCRP , SCRC } |
| There are 3 states which can be toggled that governs whether script profiling is enabled or not. More... | |
Functions | |
| static proto void | Enable (bool enable, bool immediate=false, bool sessionReset=true) |
| Enable the gathering of script profiling data. | |
| static proto int | IsEnabled () |
| Return if script profiling is enabled. | |
| static bool | IsEnabledD () |
| Return if script profiling is enabled through [DM]. | |
| static bool | IsEnabledP () |
| Return if script profiling is enabled through EnProfiler. | |
| static bool | IsEnabledC () |
| Return if script profiling is actually turned on inside of the script context. | |
| static proto void | SortData () |
| The internal sorting that happens at the end of the frame (so it is NOT necessary to call this manually) to supply Get...Per... functions. | |
| static proto void | ResetSession (bool fullReset=false) |
| Perform [SR], clearing SessionFrame, ProfiledSessionFrames, [SD] and [PD] (except for [CI]) | |
EnProfilerFlags | |
Set of functions to configure the currently active EnProfilerFlags | |
| static proto int | SetFlags (int flags, bool sessionReset=true) |
| Override the currently used set of EnProfilerFlags across the API. | |
| static proto int | GetFlags () |
| Get the currently used flags across the API. | |
| static proto bool | IsFlagsSet (int flags) |
| Check if the flags are set. | |
| static proto int | AddFlags (int flags, bool sessionReset=true) |
| Add flags to the currently used set of EnProfilerFlags across the API. | |
| static proto int | RemoveFlags (int flags, bool sessionReset=true) |
| Remove flags from the currently used set of EnProfilerFlags across the API. | |
| static proto int | ClearFlags (bool sessionReset=true) |
| Remove all flags from the currently used set of EnProfilerFlags across the API. | |
EnProfilerModule | |
Set of functions to configure the currently profiled EnProfilerModule | |
| static proto void | SetModule (EnProfilerModule module, bool sessionReset=true) |
| Set the module to be profiled. | |
| static proto EnProfilerModule | GetModule () |
| Get the currently profiled module. | |
| static proto owned string | ModuleToName (EnProfilerModule module) |
| Helper to convert EnProfilerModule to string. | |
| static proto bool | NameToModule (string moduleName, out EnProfilerModule module) |
| Convert string to EnProfilerModule. | |
| static proto void | SetInterval (int interval, bool sessionReset=true) |
| Set the interval for the [SD] to update. | |
| static proto int | GetInterval () |
| Get the currently set interval. | |
| static proto void | SetTimeResolution (int resolution) |
| Set the resolution of the fetched Time data. | |
| static proto int | GetTimeResolution () |
| Get the currently set time resolution. | |
| static proto void | EnableAverage (bool enable) |
| Enable/disable returning calculated averages. | |
| static proto bool | IsAverage () |
| Check if returning of average data is enabled. | |
| static proto void | Dump () |
| Print out [SD] to script log. | |
Frame data | |
Set of functions to obtain information about frame counts | |
| static proto int | GetGameFrame () |
| Get the total amount of frames passed. | |
| static proto int | GetSessionFrame () |
| Get the total amount of frames in this profiling session. | |
| static proto int | GetTotalFrames () |
| Get the total amount of frames across all profiling session. | |
| static proto int | GetProfiledSessionFrames () |
| Get the total amount of frames profiled in this profiling session. | |
| static proto int | GetProfiledFrames () |
| Get the total amount of frames profiled across all profiling session. | |
Sorted data | |
Set of functions to obtain [SD]
| |
| static proto void | GetTimePerClass (notnull out array< ref EnProfilerTimeClassPair > outArr, int count=int.MAX) |
| Obtain [SD] for Time Per Class. | |
| static proto void | GetAllocationsPerClass (notnull out array< ref EnProfilerCountClassPair > outArr, int count=int.MAX) |
| Obtain [SD] for Allocations Per Class. | |
| static proto void | GetInstancesPerClass (notnull out array< ref EnProfilerCountClassPair > outArr, int count=int.MAX) |
| Obtain [SD] for Instances Per Class. | |
| static proto void | GetTimePerFunc (notnull out array< ref EnProfilerTimeFuncPair > outArr, int count=int.MAX) |
| Obtain [SD] for Time Per Function. | |
| static proto void | GetCountPerFunc (notnull out array< ref EnProfilerCountFuncPair > outArr, int count=int.MAX) |
| Obtain [SD] for Count Per Function. | |
Specific data | |
Set of functions to obtain specific data | |
| static proto float | GetTimeOfClass (typename clss, bool immediate=false) |
| Obtain [SD] or [PD] regarding the time a specific class consumed. | |
| static proto int | GetAllocationsOfClass (typename clss, bool immediate=false) |
| Obtain [SD] or [PD] regarding the allocations of a specific class. | |
| static proto int | GetInstancesOfClass (typename clss, bool immediate=false) |
| Obtain [SD] or [PD] regarding the [CI] of a specific class. | |
| static proto float | GetTimeOfFunc (string funct, typename clss, bool immediate=false) |
| Obtain [SD] or [PD] regarding the time consumed by a specific function. | |
| static proto float | GetTimeOfFuncG (string funct, bool immediate=false) |
| Obtain [SD] or [PD] regarding the time consumed by a specific global function. | |
| static proto int | GetCountOfFunc (string funct, typename clss, bool immediate=false) |
| Obtain [SD] or [PD] regarding the amount of times a specific function was called. | |
| static proto int | GetCountOfFuncG (string funct, bool immediate=false) |
| Obtain [SD] or [PD] regarding the amount of times a specific function was called. | |
Misc | |
Set of helper functions | |
| static bool | RequestImmediateData () |
| Helper method to ascertain the profiler will record [PD] right after this call. | |
| typedef Param2<int, typename> EnProfilerCountClassPair |
| typedef Param2<int, string> EnProfilerCountFuncPair |
| typedef Param2<float, typename> EnProfilerTimeClassPair |
| typedef Param2<float, string> EnProfilerTimeFuncPair |
There are 3 states which can be toggled that governs whether script profiling is enabled or not.
| Enumerator | |
|---|---|
| NONE | No flags. No automatic destroying. Flags to pass to ParticleSource.StopParticle. Plain Effect base. No flags, has value 0, so will count as false in conditions. No flags |
| DIAG | Script profiling UI is enabled in WIN+ALT debug menu, when this is true, it will override SCRP. |
| SCRP | It has been set to being always enabled through EnProfiler (SCRipt Profiler) |
| SCRC | Whether profiling is currently truly happening (SCRipt Context) |
| enum EnProfilerFlags |
Flags that influences the behaviour of the EnProfiler API, applied through ...Flags functions.
| Enumerator | |
|---|---|
| NONE | No flags. No automatic destroying. Flags to pass to ParticleSource.StopParticle. Plain Effect base. No flags, has value 0, so will count as false in conditions. No flags |
| RESET | When present, will reset [PD] on sorting, otherwise will accumulate on top of it. |
| RECURSIVE | Whether to profile child modules. |
| ALL | All flags enabled. |
| enum EnProfilerModule |
Add flags to the currently used set of EnProfilerFlags across the API.
| flags | int The combination of desired EnProfilerFlags to be added to the currently used set |
| sessionReset | bool When set to false, no [SR] will trigger, regardless of situation |
int The currently used set of EnProfilerFlags after the function callReferenced by EnProfilerTests::TestAddFlags().
Remove all flags from the currently used set of EnProfilerFlags across the API.
| sessionReset | bool When set to false, no [SR] will trigger, regardless of situation |
int The currently used set of EnProfilerFlags after the function callReferenced by EnProfilerTests::TestAddFlags(), and EnProfilerTests::TestClearFlags().
|
staticprivate |
Print out [SD] to script log.
|
staticprivate |
Enable the gathering of script profiling data.
| enable | bool Whether to enable or disable, if it was previously not enabled, it will cause [SR] |
| immediate | bool When true will instantly start/stop profiling, otherwise it will apply it at the end of the frame (to have one stable point in time) |
| sessionReset | bool When set to false, no [SR] will trigger, regardless of situation |
Referenced by EnProfiler::RequestImmediateData(), EnProfilerTests::TestClassCountData(), EnProfilerTests::TestClassTimeData(), EnProfilerTests::TestFuncCountData(), EnProfilerTests::TestFuncTimeData(), EnProfilerTests::TestModule(), EnProfilerTests::TestToggling(), EnProfilerTests::TestTogglingImmediate(), and EnProfilerTests::~EnProfilerTests().
|
staticprivate |
Enable/disable returning calculated averages.
| enable | bool Whether to enable or disable |
Obtain [SD] or [PD] regarding the allocations of a specific class.
| clss | typename Typename of desired class |
| immediate | bool When true, it will pull from [SD], when false it will pull from [PD] |
int Allocations of the specified classReferenced by EnProfilerTests::TestClassCountData().
|
staticprivate |
Obtain [SD] for Allocations Per Class.
| outArr | array<ref EnProfilerCountClassPair> Array sorted by number of allocations of a class |
| count | int The maximum amount of entries wanted |
|
staticprivate |
Obtain [SD] or [PD] regarding the amount of times a specific function was called.
| funct | string Function name |
| clss | typename Typename of class the function belongs to |
| immediate | bool When true, it will pull from [SD], when false it will pull from [PD] |
int Amount of calls to the specified function or -1 when function was not foundReferenced by EnProfilerTests::TestFuncCountData().
Obtain [SD] or [PD] regarding the amount of times a specific function was called.
| funct | string Function name |
| immediate | bool When true, it will pull from [SD], when false it will pull from [PD] |
int Amount of calls to the specified function or -1 when function was not foundReferenced by EnProfilerTests::TestFuncCountData().
|
staticprivate |
Obtain [SD] for Count Per Function.
| outArr | array<ref EnProfilerCountFuncPair> Array sorted by amount of times a function was called |
| count | int The maximum amount of entries wanted |
|
staticprivate |
Get the currently used flags across the API.
int The currently used set of EnProfilerFlagsReferenced by EnProfilerTests::TestAddFlags(), EnProfilerTests::TestClearFlags(), EnProfilerTests::TestModule(), and EnProfilerTests::TestSetFlags().
|
staticprivate |
Get the total amount of frames passed.
int The total amount of frames passedObtain [SD] or [PD] regarding the [CI] of a specific class.
| clss | typename Typename of desired class |
| immediate | bool When true, it will pull from [SD], when false it will pull from [PD] |
int [CI] of the specified classReferenced by EnProfilerTests::TestClassCountData().
|
staticprivate |
Obtain [SD] for Instances Per Class.
| outArr | array<ref EnProfilerCountClassPair> Array sorted by number of instances of a class |
| count | int The maximum amount of entries wanted |
|
staticprivate |
Get the currently set interval.
int The currently set interval
|
staticprivate |
Get the currently profiled module.
EnProfilerModule The currently profiled moduleReferenced by EnProfilerTests::TestModule().
|
staticprivate |
Get the total amount of frames profiled across all profiling session.
int The total amount of frames profiled across all profiling session
|
staticprivate |
Get the total amount of frames profiled in this profiling session.
int The total amount of frames profiled in this profiling session
|
staticprivate |
Get the total amount of frames in this profiling session.
int The total amount of frames in this profiling sessionObtain [SD] or [PD] regarding the time a specific class consumed.
| clss | typename Typename of desired class |
| immediate | bool When true, it will pull from [SD], when false it will pull from [PD] |
float Time consumed by the specified classReferenced by EnProfilerTests::TestClassTimeData().
|
staticprivate |
Obtain [SD] or [PD] regarding the time consumed by a specific function.
| funct | string Function name |
| clss | typename Typename of class the function belongs to |
| immediate | bool When true, it will pull from [SD], when false it will pull from [PD] |
float Time consumed by the specified function or -1 when function was not foundReferenced by EnProfilerTests::TestFuncTimeData(), and EnProfilerTests::TestModule().
Obtain [SD] or [PD] regarding the time consumed by a specific global function.
| funct | string Function name |
| immediate | bool When true, it will pull from [SD], when false it will pull from [PD] |
float Time consumed by the specified function or -1 when function was not found
|
staticprivate |
Obtain [SD] for Time Per Class.
| outArr | array<ref EnProfilerTimeClassPair> Array sorted by time consumed by a class |
| count | int The maximum amount of entries wanted |
Referenced by EnProfilerTests::TestModule().
|
staticprivate |
Obtain [SD] for Time Per Function.
| outArr | array<ref EnProfilerTimeFuncPair> Array sorted by time consumed by a function |
| count | int The maximum amount of entries wanted |
Referenced by EnProfilerTests::TestModule().
|
staticprivate |
Get the currently set time resolution.
int The currently set resolutionReferenced by EnProfilerTests::TestClassTimeData(), EnProfilerTests::TestFuncTimeData(), and EnProfilerTests::TestModule().
|
staticprivate |
Get the total amount of frames across all profiling session.
int The total amount of frames across all profiling session
|
staticprivate |
Check if returning of average data is enabled.
bool Whether returning of average data is enabled
|
staticprivate |
Return if script profiling is enabled.
int Flags regarding the current stateReferenced by EnProfiler::IsEnabledC(), EnProfiler::IsEnabledD(), and EnProfiler::IsEnabledP().
|
inlinestaticprivate |
Return if script profiling is actually turned on inside of the script context.
bool Whether script is being profiled as of this momentReferences EnProfiler::IsEnabled().
Referenced by EnProfilerTests::EnProfilerTests(), EnProfiler::RequestImmediateData(), and EnProfilerTests::TestTogglingImmediate().
|
inlinestaticprivate |
Return if script profiling is enabled through [DM].
bool Whether script profiling is enabled through [DM]References EnProfiler::IsEnabled().
|
inlinestaticprivate |
Return if script profiling is enabled through EnProfiler.
bool Whether script profiling is enabled through script profilerReferences EnProfiler::IsEnabled().
Referenced by EnProfilerTests::TestToggling().
Check if the flags are set.
| flags | int The combination of EnProfilerFlags to check if present |
bool If the flags are set
|
staticprivate |
Helper to convert EnProfilerModule to string.
| module | EnProfilerModule The module to get the name of |
string The name of the module
|
staticprivate |
Convert string to EnProfilerModule.
| moduleName | string The name of the module |
| module | EnProfilerModule The enum value of the module or EnProfilerModule.ERROR if not found |
bool Whether the module was foundReferenced by EnProfilerTests::TestModule().
Remove flags from the currently used set of EnProfilerFlags across the API.
| flags | int The combination of desired EnProfilerFlags to be added to the currently used set |
| sessionReset | bool When set to false, no [SR] will trigger, regardless of situation |
int The currently used set of EnProfilerFlags after the function callReferenced by EnProfilerTests::TestClearFlags(), and EnProfilerTests::TestModule().
|
inlinestaticprivate |
Helper method to ascertain the profiler will record [PD] right after this call.
bool Whether it was enabled before or notReferences EnProfiler::Enable(), and EnProfiler::IsEnabledC().
Referenced by EnProfilerTests::TestClassCountData(), EnProfilerTests::TestClassTimeData(), EnProfilerTests::TestFuncCountData(), EnProfilerTests::TestFuncTimeData(), and EnProfilerTests::TestModule().
|
staticprivate |
Perform [SR], clearing SessionFrame, ProfiledSessionFrames, [SD] and [PD] (except for [CI])
| fullReset | bool Whether to clear [PD] of all modules, when false it will only clear the [PD] according to current settings |
Referenced by EnProfilerTests::TestModule().
Override the currently used set of EnProfilerFlags across the API.
| flags | int The combination of desired EnProfilerFlags to override the currently used set |
| sessionReset | bool When set to false, no [SR] will trigger, regardless of situation |
int The currently used set of EnProfilerFlags after the function callReferenced by EnProfilerTests::TestAddFlags(), EnProfilerTests::TestClearFlags(), EnProfilerTests::TestModule(), and EnProfilerTests::TestSetFlags().
Set the interval for the [SD] to update.
| interval | int Amount of frames to wait before [SD] is updated |
| sessionReset | bool When set to false, no [SR] will trigger, regardless of situation |
|
staticprivate |
Set the module to be profiled.
| module | EnProfilerModule The module to profile |
| sessionReset | bool When set to false, no [SR] will trigger, regardless of situation |
Referenced by EnProfilerTests::TestModule().
|
staticprivate |
Set the resolution of the fetched Time data.
| resolution | int The nth resolution of a second |
Referenced by EnProfilerTests::TestClassTimeData(), EnProfilerTests::TestFuncTimeData(), and EnProfilerTests::TestModule().
|
staticprivate |
The internal sorting that happens at the end of the frame (so it is NOT necessary to call this manually) to supply Get...Per... functions.
Referenced by EnProfilerTests::TestModule().