Skip to content

ServerMetrics beta ​

Interface of @v12-engine/engine/server

ts
export interface ServerMetrics

What a game server says of itself: the numbers of /metrics (GameServer.metrics)

Members ​

bytesSent ​

ts
bytesSent: number;

Bytes sent to those connected now, over the wire

connections ​

ts
connections: number;

Connections open, seated or not

draining ​

ts
draining: boolean;

It takes no new games: it is stopping, once the running one is over (close({ drain }))

games ​

ts
games: {
        running: number;
        played: number;
    };

Games running now (0 or 1 for one server), and played to their end since it started

lastTickSeconds ​

ts
lastTickSeconds: number;

Seconds the most recent tick took

phase ​

ts
phase: 'lobby' | 'game' | 'ended';

In its lobby, playing, or showing a game that ended

players ​

ts
players: number;

Seats held by someone connected, and those watching

sends ​

ts
sends: number;

Rounds of sending everyone what changed, and the seconds they took

sendSeconds ​

ts
sendSeconds: number;

Total seconds the rounds of sending have taken since the server started

ticks ​

ts
ticks: number;

Ticks of the simulation stepped since it started, and the seconds they took; how long the last one took

tickSeconds ​

ts
tickSeconds: number;

Total seconds the simulation ticks have taken since the server started

uptime ​

ts
uptime: number;

Seconds since it started

watching ​

ts
watching: number;

Connections watching the game without a seat