feat: add server latency to the influx points
All checks were successful
Deploy CI / deploy (push) Successful in 15s
Publish Docker Image / docker (push) Successful in 45s

This commit is contained in:
Lee 2024-01-10 10:47:25 +00:00
parent ab53e24978
commit 98cb26e310

View File

@ -69,6 +69,7 @@ export default class Server {
* @returns the ping response or undefined if the server is offline
*/
public async pingServer(): Promise<Ping | undefined> {
const before = Date.now();
try {
let response;
@ -92,6 +93,7 @@ export default class Server {
new Point("playerCount")
.tag("name", this.getName())
.intField("playerCount", response.playerCount)
.intField("latency", Date.now() - before)
.timestamp(response.timestamp)
);
} catch (err) {