Skip to content

Commit

Permalink
Merge pull request #3637 from elsirion/2023-11-backport-timing
Browse files Browse the repository at this point in the history
backport: chore: add timing logs to module audits
  • Loading branch information
elsirion committed Nov 20, 2023
2 parents c2b500a + f79e2c0 commit e59f0ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fedimint-core/src/timing.rs
Expand Up @@ -87,10 +87,10 @@ pub struct TimeReporter {
}

impl TimeReporter {
pub fn new(name: &'static str) -> Self {
pub fn new(name: impl Into<Cow<'static, str>>) -> Self {
Self {
inner: Some(TimeReporterInner {
name: Cow::from(name),
name: name.into(),
level: Level::DEBUG,
start: crate::time::now(),
threshold: None,
Expand Down
2 changes: 2 additions & 0 deletions fedimint-server/src/consensus/mod.rs
Expand Up @@ -535,6 +535,8 @@ impl FedimintConsensus {
let mut dbtx = self.db.begin_transaction().await;
let mut audit = Audit::default();
for (module_instance_id, _, module) in self.modules.iter_modules() {
let _module_audit_timing =
timing::TimeReporter::new(format!("audit module {module_instance_id}"));
module
.audit(&mut dbtx.with_module_prefix(module_instance_id), &mut audit)
.await
Expand Down

0 comments on commit e59f0ed

Please sign in to comment.