push RCON stats to influx
Kind: global class
- RconStats
- new RconStats(address, password, onStats)
- ._connect() ⇒
Promise.<Void>
- ._getStats() ⇒
Promise.<String>
- ._parseStats(response) ⇒
CallableFunction.<Object>
- ._ping() ⇒
Void
run RCON stats and log response in influxdb to be graphed in grafana
Param | Type |
---|---|
address | String |
password | String |
onStats | function |
Example (Example usage of RconStats Class.)
new RconStats('127.0.0.1', 'suspersecurepassword', stats => {
// stats object that was logged to database
});
connects to the game server rcon
Kind: instance method of RconStats
Returns: Promise.<Void>
- nothing
Example (Example usage of _connect() function.)
RconStats._connect().then(_ => {
// connected
});
runs stats command
Kind: instance method of RconStats
Returns: Promise.<String>
- rcon stats output
Example (Example usage of _getStats() function.)
RconStats._getStats().then(res => {
// res = stats output string
});
get usable data from the response then loges it to database before passing it to the callback function
Kind: instance method of RconStats
Returns: CallableFunction.<Object>
- fires when stats are processed
Param | Type |
---|---|
response | String |
Example (Example usage of _parseStats() function.)
RconStats._parseStats(res);
loop to get data at a preset interval
Kind: instance method of RconStats
Returns: Void
- nothing
Example (Example usage of _ping() function.)
RconStats._ping();