Updated Common Item data proto
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user