Updated Common Item data proto

This commit is contained in:
2025-06-10 14:24:56 -04:00
parent 6f18b53913
commit 87b233d366
3 changed files with 24 additions and 18 deletions

View File

@@ -8,6 +8,7 @@ use crate::packet::Packet;
use crate::packet_type::PacketType;
use std::error::Error;
use std::sync::Arc;
use std::time::Instant;
use tokio::io::{AsyncReadExt, ReadHalf};
use tokio::net::TcpStream;
use tokio::sync::Mutex;
@@ -42,8 +43,8 @@ impl PacketRouter {
PACKETS_RECEIVED.inc();
let timer = PACKET_PROCESSING_TIME.start_timer();
// Process the packet
let start = Instant::now();
match Packet::from_raw(&buffer[..packet_size]) {
Ok(packet) => {
debug!("Parsed Packet: {:?}", packet);
@@ -51,7 +52,8 @@ impl PacketRouter {
}
Err(e) => warn!("Failed to parse packet: {}", e),
}
timer.stop_and_record();
let duration = start.elapsed();
PACKET_PROCESSING_TIME.observe(duration.as_secs_f64());
pool.release(buffer).await;
}