MAJOR rework

- improves a lot on the Go side including better config and logging libraries (including log rotation), better internal package distribution, and new a3go functionality to make data transfer more performant
- SQF side preprocessing of capture data is now minimal - arrays in hashmap format are sent directly to the extension and parsed there to minimize game impact
- CBA custom events are implemented in a better fashion
- README update
- license change
- with performance improvements, the deep customization of integrated metric gathering is removed in return to a single refreshRateMs, defining the interval at which core metrics are captured
- peeled back the list of core metrics to the core information used in troubleshooting and benchmarking
This commit is contained in:
2023-10-10 00:44:50 -07:00
parent cf45d6b263
commit dc822c4c93
75 changed files with 4335 additions and 3347 deletions

View File

@@ -0,0 +1 @@
x\ifxmetrics\addons\capture

26
addons/capture/config.cpp Normal file
View File

@@ -0,0 +1,26 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = 2.10;
requiredAddons[] = {"cba_main"};
author[] = {"IndigoFox"};
authorUrl = "https://github.com/indig0fox/IFXMetrics";
};
};
class CfgFunctions {
class ADDON {
class functions {
PATHTO_FNC(entity_count);
PATHTO_FNC(player_performance);
PATHTO_FNC(running_mission);
PATHTO_FNC(running_scripts);
PATHTO_FNC(server_performance);
PATHTO_FNC(server_time);
PATHTO_FNC(weather);
};
};
};

View File

@@ -0,0 +1,129 @@
#include "script_component.hpp"
private _hashesOut = [];
private _allUnits = allUnits;
private _allDeadMen = allDeadMen;
private _allGroups = allGroups;
private _vehicles = vehicles;
private _allPlayers = call BIS_fnc_listPlayers;
{
private _thisSide = _x;
private _thisSideStr = _thisSide call BIS_fnc_sideNameUnlocalized;
// Number of remote units
_hashesOut pushBack ([
["bucket", "server_performance"],
["measurement", "entities_remote"],
["tags", GVARMAIN(standardTags)],
["fields", [
["units_alive", {
side _x isEqualTo _thisSide &&
not (local _x)
} count _allUnits],
["units_dead", {
side _x isEqualTo _thisSide &&
not (local _x)
} count _allDeadMen],
["groups_total", {
side _x isEqualTo _thisSide &&
not (local _x)
} count _allGroups],
["vehicles_total", {
side _x isEqualTo _thisSide &&
not (local _x) &&
!(_x isKindOf "WeaponHolderSimulated")
} count _vehicles],
["vehicles_weaponholder", {
side _x isEqualTo _thisSide &&
not (local _x) &&
(_x isKindOf "WeaponHolderSimulated")
} count _vehicles]
]]
]);
// Number of local units
_hashesOut pushBack ([
["bucket", "server_performance"],
["measurement", "entities_local"],
["tags", GVARMAIN(standardTags)],
["fields", [
["units_alive", {
side _x isEqualTo _thisSide &&
local _x
} count _allUnits],
["units_dead", {
side _x isEqualTo _thisSide &&
local _x
} count _allDeadMen],
["groups_total", {
side _x isEqualTo _thisSide &&
local _x
} count _allGroups],
["vehicles_total", {
side _x isEqualTo _thisSide &&
local _x &&
!(_x isKindOf "WeaponHolderSimulated")
} count _vehicles],
["vehicles_weaponholder", {
side _x isEqualTo _thisSide &&
local _x &&
(_x isKindOf "WeaponHolderSimulated")
} count _vehicles]
]]
]);
// Number of global units - only track on server
if (isServer) then {
_hashesOut pushBack ([
["bucket", "server_performance"],
["measurement", "entities_global"],
["tags", GVARMAIN(standardTags)],
["fields", [
["units_alive", {
side _x isEqualTo _thisSide
} count _allUnits],
["units_dead", {
side _x isEqualTo _thisSide
} count _allDeadMen],
["groups_total", {
side _x isEqualTo _thisSide
} count _allGroups],
["vehicles_total", {
side _x isEqualTo _thisSide &&
!(_x isKindOf "WeaponHolderSimulated")
} count _vehicles],
["vehicles_weaponholder", {
side _x isEqualTo _thisSide &&
(_x isKindOf "WeaponHolderSimulated")
} count _vehicles],
["players_alive", {
side _x isEqualTo _thisSide &&
alive _x
} count _allPlayers],
["players_dead", {
side _x isEqualTo _thisSide &&
!alive _x
} count _allPlayers]
]]
]);
};
} forEach [east, west, independent, civilian];
if (isServer) then {
_hashesOut pushBack ([
["bucket", "server_performance"],
["measurement", "player_count"],
["tags", GVARMAIN(standardTags)],
["fields", [
["players_connected", {
private _info = getUserInfo (getPlayerId _x);
if (!isNil "_info" && {count _info >= 6}) then {
_info select 7
} else {false}
} count _allPlayers]
]]
]);
};
_hashesOut;

View File

@@ -0,0 +1,28 @@
#include "script_component.hpp"
private _hashesOut = [];
{
_x params ["_playerID", "_ownerId", "_playerUID", "_profileName", "_displayName", "_steamName", "_clientState", "_isHC", "_adminState", "_networkInfo", "_unit"];
_networkInfo params ["_avgPing", "_avgBandwidth", "_desync"];
if (_unit == objNull || _isHC) then {
continue;
};
_tags = +GVARMAIN(standardTags);
_tags pushBack ["playerUID", _playerUID];
_tags pushBack ["playerName", _profileName];
_hashesOut pushBack ([
["bucket", "player_performance"],
["measurement", "network"],
["tags", _tags],
["fields", [
["avgPing", _avgPing],
["avgBandwidth", _avgBandwidth],
["desync", _desync]
]]
]);
} forEach (allUsers apply {getUserInfo _x});
_hashesOut;

View File

@@ -0,0 +1,23 @@
#include "script_component.hpp"
[
["bucket", "mission_data"],
["measurement", "loaded_info"],
["tags", GVARMAIN(standardTags)],
["fields", [
["briefing_name", briefingName],
["mission_name", missionName],
["mission_name_source", missionNameSource],
[
"on_load_name",
getMissionConfigValue ["onLoadName", "Unknown"]
],
["author", getMissionConfigValue ["author", "Unknown"]],
["server_name", serverName],
["playable_slots_west", playableSlotsNumber west],
["playable_slots_east", playableSlotsNumber east],
["playable_slots_guer", playableSlotsNumber independent],
["playable_slots_civ", playableSlotsNumber civilian],
["playable_slots_logic", playableSlotsNumber sideLogic]
]]
];

View File

@@ -0,0 +1,18 @@
#include "script_component.hpp"
[
["bucket", "server_performance"],
["measurement", "running_scripts"],
["tags", GVARMAIN(standardTags)],
["fields", [
["spawn", diag_activeScripts select 0],
["execVM", diag_activeScripts select 1],
["exec", diag_activeScripts select 2],
["execFSM", diag_activeScripts select 3],
["pfh",
if (GVARMAIN(cbaLoaded)) then {
count CBA_common_perFrameHandlerArray
} else {0}
]
]]
];

View File

@@ -0,0 +1,11 @@
#include "script_component.hpp"
[
["bucket", "server_performance"],
["measurement", "fps"],
["tags", GVARMAIN(standardTags)],
["fields", [
["fps_avg", diag_fps],
["fps_min", diag_fpsMin]
]]
];

View File

@@ -0,0 +1,13 @@
#include "script_component.hpp"
[
["bucket", "mission_data"],
["measurement", "server_time"],
["tags", GVARMAIN(standardTags)],
["fields", [
["diag_tickTime", diag_tickTime],
["serverTime", time],
["timeMultiplier", timeMultiplier],
["accTime", accTime]
]]
];

View File

@@ -0,0 +1,21 @@
#include "script_component.hpp"
[
["bucket", "mission_data"],
["measurement", "weather"],
["tags", GVARMAIN(standardTags)],
["fields", [
["fog", fog],
["overcast", overcast],
["rain", rain],
["humidity", humidity],
["waves", waves],
["windDir", windDir],
["windStr", windStr],
["gusts", gusts],
["lightnings", lightnings],
["moonIntensity", moonIntensity],
["moonPhase", moonPhase date],
["sunOrMoon", sunOrMoon]
]]
];

View File

@@ -0,0 +1,4 @@
#define COMPONENT capture
#define COMPONENT_BEAUTIFIED Capture
#include "\x\ifxmetrics\addons\main\script_mod.hpp"