start framework for settings.json control

This commit is contained in:
2023-04-13 00:08:02 -07:00
parent 67541f46f9
commit c687d1a3f1
2 changed files with 74 additions and 6 deletions

View File

@@ -1,12 +1,19 @@
if (!RangerMetrics_run) exitWith {}; if (!RangerMetrics_run) exitWith {};
private _settings = "recordingSettings.serverPolling.userPerformance" call RangerMetrics_fnc_getSetting;
if (!_settings) exitWith {
[format["Error in settings lookup: %1", _settingsPath]] call RangerMetrics_fnc_log;
};
if !(_settings get "enabled") exitWith {false};
{ {
_x params ["_playerID", "_ownerId", "_playerUID", "_profileName", "_displayName", "_steamName", "_clientState", "_isHC", "_adminState", "_networkInfo", "_unit"]; _x params ["_playerID", "_ownerId", "_playerUID", "_profileName", "_displayName", "_steamName", "_clientState", "_isHC", "_adminState", "_networkInfo", "_unit"];
_networkInfo params ["_avgPing", "_avgBandwidth", "_desync"]; _networkInfo params ["_avgPing", "_avgBandwidth", "_desync"];
[ [
"player_state", _settings get "bucket",
"player_performance", _settings get "measurement",
[["string", "playerUID", _playerUID]], [["string", "playerUID", _playerUID]],
[ [
["float", "avgPing", _avgPing], ["float", "avgPing", _avgPing],

View File

@@ -1,6 +1,67 @@
{ {
"host" : "http://INFLUX_URL:8086", "influxdb": {
"token": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX_AUTH_TOKEN_XXXXXXXXXXXXXXXXXXXXXXXXXXX", "host": "http://INFLUX_URL:8086",
"org" : "ORG_NAME", "token": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX_AUTH_TOKEN_XXXXXXXXXXXXXXXXXXXXXXXXXXX",
"bucket" : "BUCKET_NAME", "org": "ORG_NAME"
},
"arma3": {
"refreshRateMs": 1000,
"debug": true
},
"recordingSettings": {
"serverPolling": {
"serverPerformance": {
"enabled": true,
"useWith": [
"server",
"headlessClient"
],
"runOnServer": true,
"runOnHeadlessClient": true,
"monitorIntervalInSeconds": 1,
"bucket": "performance",
"measurement": "server_performance",
"description": "Host or Headless Client performance. Tracks average and minimum FPS.",
"filePath": "functions/capture/server_performance.sqf"
},
"userPerformance": {
"enabled": true,
"useWith": [
"server"
],
"runOnServer": true,
"monitorIntervalInSeconds": 3,
"bucket": "network",
"measurement": "user_network",
"description": "User network performance. Tracks average ping, average bandwidth, and desync.",
"filePath": "functions/capture/player_performance.sqf"
},
"runningScripts": {
"enabled": true,
"useWith": [
"server",
"headlessClient"
],
"runOnServer": true,
"runOnHeadlessClient": true,
"monitorIntervalInSeconds": 3,
"bucket": "performance",
"measurement": "running_scripts",
"description": "Count of running scripts obtained via . Tracks the number of scripts running on the server and headless client.",
"filePath": "functions/capture/running_scripts.sqf"
},
"runningMission": {
"enabled": true,
"useWith": [
"server"
],
"runOnServer": true,
"monitorIntervalInSeconds": 300,
"bucket": "mission_data",
"measurement": "mission_name",
"description": "Tracks the name of the mission running on the server.",
"filePath": "functions/capture/running_mission.sqf"
}
}
}
} }