Skip to content

Commit

Permalink
Plugins: Add temporary basic benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
AmmarAbouZor committed Nov 8, 2024
1 parent 97b40bf commit 4ac8801
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions application/apps/indexer/session/src/handlers/observing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ async fn run_producer<T: LogMessage, P: Parser<T>, S: ByteSource>(
let stream = producer.as_stream();
futures::pin_mut!(stream);
let cancel_on_tail = cancel.clone();
let timer = std::time::Instant::now();
while let Some(next) = select! {
next_from_stream = async {
match timeout(Duration::from_millis(FLUSH_TIMEOUT_IN_MS as u64), stream.next()).await {
Expand Down Expand Up @@ -200,6 +201,17 @@ async fn run_producer<T: LogMessage, P: Parser<T>, S: ByteSource>(
}
MessageStreamItem::Done => {
trace!("observe, message stream is done");

//TODO AAZ: Remove benchmarks when not needed anymore.
let elapsed = timer.elapsed();
println!("---------------------------------------------------------");
println!("---------------------------------------------------------");
println!("---------------------------------------------------------");
println!("File Read Took: {}", elapsed.as_millis());
println!("---------------------------------------------------------");
println!("---------------------------------------------------------");
println!("---------------------------------------------------------");

state.flush_session_file().await?;
state.file_read().await?;
}
Expand Down

0 comments on commit 4ac8801

Please sign in to comment.