- add: utils library

- add: packet-service to handle game client packets
- fix: health check for database-service
- fix: health check for auth-service
This commit is contained in:
2024-12-09 23:10:26 -05:00
parent 20e86dd117
commit e5c961d1b4
25 changed files with 1176 additions and 120 deletions

View File

@@ -0,0 +1,22 @@
use prometheus::{Encoder, TextEncoder, Counter, Gauge, Histogram, register_counter, register_gauge, register_histogram};
use lazy_static::lazy_static;
lazy_static! {
// Counter to track the number of packets received
pub static ref PACKETS_RECEIVED: Counter = register_counter!(
"packets_received_total",
"Total number of packets received"
).unwrap();
// Gauge to track the number of active connections
pub static ref ACTIVE_CONNECTIONS: Gauge = register_gauge!(
"active_connections",
"Number of currently active connections"
).unwrap();
// Histogram to track packet processing latency
pub static ref PACKET_PROCESSING_TIME: Histogram = register_histogram!(
"packet_processing_time_seconds",
"Histogram of packet processing times"
).unwrap();
}