Fixed stats
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 5m45s
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 5m45s
This commit is contained in:
parent
878df8da40
commit
3e726c713f
|
@ -19,15 +19,15 @@ pub struct Stats {
|
||||||
|
|
||||||
impl Stats {
|
impl Stats {
|
||||||
pub fn add_connection(&self) {
|
pub fn add_connection(&self) {
|
||||||
self.connections.store(1, Ordering::Relaxed);
|
self.connections.fetch_add(1, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_rx_bytes(&self, n: usize) {
|
pub fn add_rx_bytes(&self, n: usize) {
|
||||||
self.rx.store(n, Ordering::Relaxed);
|
self.rx.fetch_add(n, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_tx_bytes(&self, n: usize) {
|
pub fn add_tx_bytes(&self, n: usize) {
|
||||||
self.tx.store(n, Ordering::Relaxed);
|
self.tx.fetch_add(n, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn connections(&self) -> usize {
|
pub fn connections(&self) -> usize {
|
||||||
|
@ -39,7 +39,7 @@ impl Stats {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_failed(&self, failed: bool) {
|
pub fn set_failed(&self, failed: bool) {
|
||||||
self.failed.store(failed, Ordering::Relaxed);
|
self.failed.fetch_and(failed, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn rx(&self) -> Unit {
|
pub fn rx(&self) -> Unit {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user