Skip to content
Snippets Groups Projects
Commit 2a304c2b authored by Jason Volk's avatar Jason Volk
Browse files

add some usage stats output on the mutex maps


Signed-off-by: default avatarJason Volk <jason@zemos.net>
parent 271f7202
No related branches found
No related tags found
1 merge request!520Panic / Error Handling
......@@ -3,6 +3,7 @@
use std::{
collections::{hash_map, BTreeMap, HashMap, HashSet},
fmt::Write,
pin::Pin,
sync::{Arc, RwLock as StdRwLock},
time::Instant,
......@@ -61,6 +62,20 @@ fn build(_args: crate::Args<'_>) -> Result<Arc<Self>> {
}))
}
fn memory_usage(&self, out: &mut dyn Write) -> Result<()> {
let mutex_federation = self.mutex_federation.len();
writeln!(out, "federation_mutex: {mutex_federation}")?;
let federation_handletime = self
.federation_handletime
.read()
.expect("locked for reading")
.len();
writeln!(out, "federation_handletime: {federation_handletime}")?;
Ok(())
}
fn name(&self) -> &str { crate::service::make_name(std::module_path!()) }
}
......
......@@ -2,6 +2,7 @@
use std::{
collections::{HashMap, HashSet},
fmt::Write,
sync::Arc,
};
......@@ -40,6 +41,13 @@ fn build(args: crate::Args<'_>) -> Result<Arc<Self>> {
}))
}
fn memory_usage(&self, out: &mut dyn Write) -> Result<()> {
let mutex = self.mutex.len();
writeln!(out, "state_mutex: {mutex}")?;
Ok(())
}
fn name(&self) -> &str { crate::service::make_name(std::module_path!()) }
}
......
......@@ -92,6 +92,9 @@ fn memory_usage(&self, out: &mut dyn Write) -> Result<()> {
.len();
writeln!(out, "lasttimelinecount_cache: {lasttimelinecount_cache}")?;
let mutex_insert = self.mutex_insert.len();
writeln!(out, "insert_mutex: {mutex_insert}")?;
Ok(())
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment