FEAT: added a prometheus gauge for the number of active rooms
This commit is contained in:
@@ -6,8 +6,13 @@ class GaugeManager {
|
||||
private nbClientsPerRoomGauge: Gauge<string>;
|
||||
private nbGroupsPerRoomGauge: Gauge<string>;
|
||||
private nbGroupsPerRoomCounter: Counter<string>;
|
||||
private nbRoomsGauge: Gauge<string>;
|
||||
|
||||
constructor() {
|
||||
this.nbRoomsGauge = new Gauge({
|
||||
name: 'workadventure_nb_rooms',
|
||||
help: 'Number of active rooms'
|
||||
});
|
||||
this.nbClientsGauge = new Gauge({
|
||||
name: 'workadventure_nb_sockets',
|
||||
help: 'Number of connected sockets',
|
||||
@@ -31,6 +36,13 @@ class GaugeManager {
|
||||
});
|
||||
}
|
||||
|
||||
incNbRoomGauge(): void {
|
||||
this.nbRoomsGauge.inc();
|
||||
}
|
||||
decNbRoomGauge(): void {
|
||||
this.nbRoomsGauge.dec();
|
||||
}
|
||||
|
||||
incNbClientPerRoomGauge(roomId: string): void {
|
||||
this.nbClientsGauge.inc();
|
||||
this.nbClientsPerRoomGauge.inc({ room: roomId });
|
||||
|
||||
Reference in New Issue
Block a user