- 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:
22
packet-service/src/metrics.rs
Normal file
22
packet-service/src/metrics.rs
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user