Skip to content

Commit

Permalink
CVPN-956: renaming metric for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
kp-stanislav-baiduzhyi committed Jun 20, 2024
1 parent 051c962 commit 8b1180c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lightway-app-utils/src/iouring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bytes::{BufMut, BytesMut};
use dashmap::DashMap;
use thiserror::Error;

use crate::metrics::tun_iouring_data_dropped;
use crate::metrics::tun_iouring_packet_dropped;
use io_uring::{
cqueue::Entry as CEntry, opcode, squeue::Entry as SEntry, types::Fixed, CompletionQueue,
IoUring,
Expand Down Expand Up @@ -197,7 +197,7 @@ impl<T: AsRawFd> IOUring<T> {
Err(e) if e.is_full() => {
// it is effectively the same scenario as a buffer in a network
// switch/router filling up so dropping the traffic is appropriate
tun_iouring_data_dropped();
tun_iouring_packet_dropped();
Ok(())
}
Err(e) => Err(IOUringError::SendError(e)),
Expand Down
6 changes: 3 additions & 3 deletions lightway-app-utils/src/metrics.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use metrics::counter;

const METRIC_TUN_IOURING_DATA_DROPPED: &str = "tun_iouring_data_dropped";
const METRIC_TUN_IOURING_PACKET_DROPPED: &str = "tun_iouring_packet_dropped";

/// Counter for "sending into a full channel" type of error ([`async_channel::TrySendError::Full`])
pub(crate) fn tun_iouring_data_dropped() {
counter!(METRIC_TUN_IOURING_DATA_DROPPED).increment(1);
pub(crate) fn tun_iouring_packet_dropped() {
counter!(METRIC_TUN_IOURING_PACKET_DROPPED).increment(1);
}

0 comments on commit 8b1180c

Please sign in to comment.