diff --git a/src/cli/get_room_states.rs b/src/cli/get_room_states.rs index d6e9c373..00eafb2e 100644 --- a/src/cli/get_room_states.rs +++ b/src/cli/get_room_states.rs @@ -6,6 +6,8 @@ use std::{cmp::Ordering, collections::BTreeSet, sync::Arc}; use ruma::{events::StateEventType, EventId}; use serde::Serialize; +use tokio::time::Instant; +use tracing as t; use super::GetRoomStatesArgs; use crate::{ @@ -89,12 +91,16 @@ pub(crate) async fn run( db.apply_migrations().await.map_err(Error::Database)?; + let start = Instant::now(); + let room_states = if args.recompute { recompute::get_room_states(db, &args.select) } else { cache::get_room_states(db, &args.select).await }; + t::info!(duration = ?start.elapsed(), "Finished getting states"); + serde_json::to_writer(std::io::stdout(), &room_states)?; Ok(())