2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2016-05-30 16:37:03 +00:00
|
|
|
/*
|
|
|
|
* Author: ?
|
|
|
|
* Dumps performance counter statistics into Logs.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* call ace_common_fnc_dumpPerformanceCounters
|
|
|
|
*
|
2016-05-30 16:37:03 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
diag_log text format ["REGISTERED ACE PFH HANDLERS"];
|
|
|
|
diag_log text format ["-------------------------------------------"];
|
|
|
|
|
|
|
|
if (!isNil "ACE_PFH_COUNTER") then {
|
|
|
|
{
|
|
|
|
_x params ["_pfh", "_parameters"];
|
|
|
|
|
|
|
|
private _isActive = ["ACTIVE", "REMOVED"] select isNil {CBA_common_PFHhandles select (_pfh select 0)};
|
|
|
|
|
|
|
|
diag_log text format ["Registered PFH: id=%1 [%2, delay %3], %4:%5", _pfh select 0, _isActive, _parameters select 1, _pfh select 1, _pfh select 2];
|
2024-04-04 11:15:26 +00:00
|
|
|
} forEach ACE_PFH_COUNTER;
|
2016-05-30 16:37:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
diag_log text format ["ACE COUNTER RESULTS"];
|
|
|
|
diag_log text format ["-------------------------------------------"];
|
|
|
|
|
|
|
|
{
|
|
|
|
private _counterEntry = _x;
|
|
|
|
private _iter = 0;
|
|
|
|
private _total = 0;
|
|
|
|
private _count = 0;
|
|
|
|
private _averageResult = 0;
|
|
|
|
|
|
|
|
if (count _counterEntry > 3) then {
|
|
|
|
// calc
|
|
|
|
{
|
|
|
|
if (_iter > 2) then {
|
|
|
|
_count = _count + 1;
|
|
|
|
private _delta = (_x select 1) - (_x select 0);
|
|
|
|
|
|
|
|
_total = _total + _delta;
|
|
|
|
};
|
|
|
|
|
|
|
|
_iter = _iter + 1;
|
2024-04-04 11:15:26 +00:00
|
|
|
} forEach _counterEntry;
|
2016-05-30 16:37:03 +00:00
|
|
|
|
|
|
|
// results
|
|
|
|
_averageResult = (_total / _count) * 1000;
|
|
|
|
|
|
|
|
// dump results
|
|
|
|
diag_log text format ["%1: Average: %2s / %3 = %4ms", _counterEntry select 0, _total, _count, _averageResult];
|
|
|
|
} else {
|
|
|
|
diag_log text format ["%1: No results", _counterEntry select 0];
|
|
|
|
};
|
2024-04-04 11:15:26 +00:00
|
|
|
} forEach ACE_COUNTERS;
|
2016-05-30 16:37:03 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
// Dump PFH Trackers
|
|
|
|
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"];
|
|
|
|
diag_log text format["-------------------------------------------"];
|
|
|
|
{
|
|
|
|
private _delay = _x select 2;
|
|
|
|
//if(_delay > 0) then { _delay = _delay / 1000; };
|
|
|
|
|
|
|
|
diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)];
|
|
|
|
} forEach ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER;
|
|
|
|
|
|
|
|
// Dump PFH Trackers
|
|
|
|
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"];
|
|
|
|
diag_log text format["-------------------------------------------"];
|
|
|
|
{
|
|
|
|
private _delta = _x select 1;
|
|
|
|
//if(_delta > 0) then { _delta = _delta / 1000; };
|
|
|
|
diag_log text format[" DELTA: %1s", _delta];
|
|
|
|
} forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER;
|
|
|
|
|
|
|
|
//{
|
|
|
|
//
|
|
|
|
//} forEach ACRE_EXCESSIVE_FRAME_TRACKER;
|
|
|
|
|
|
|
|
*/
|