Finally fixed a stupid tracing bug with counters

This commit is contained in:
Igor Katson 2023-11-20 01:13:06 +00:00
parent aa99872e52
commit 88c2f9e926
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5

View file

@ -9,7 +9,6 @@ use librqbit_core::lengths::{ChunkInfo, ValidPieceIndex};
use serde::Serialize; use serde::Serialize;
use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender}; use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender};
use tokio::sync::{Notify, Semaphore}; use tokio::sync::{Notify, Semaphore};
use tracing::trace;
use crate::peer_connection::WriterRequest; use crate::peer_connection::WriterRequest;
use crate::type_aliases::BF; use crate::type_aliases::BF;
@ -100,19 +99,11 @@ impl AggregatePeerStatsAtomic {
} }
pub fn inc(&self, state: &PeerState) { pub fn inc(&self, state: &PeerState) {
trace!( atomic_inc(self.counter(state));
"inc, new value = {}, state = {}",
atomic_inc(self.counter(state)),
state
);
} }
pub fn dec(&self, state: &PeerState) { pub fn dec(&self, state: &PeerState) {
trace!( atomic_dec(self.counter(state));
"dec, new value = {}, state = {}",
atomic_dec(self.counter(state)),
state
);
} }
pub fn incdec(&self, old: &PeerState, new: &PeerState) { pub fn incdec(&self, old: &PeerState, new: &PeerState) {