Display the time it took to process an update

This commit is contained in:
Kerollmops 2020-12-20 23:43:31 +01:00
parent 9fcbc83ebc
commit 6c7db3d956
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -322,6 +322,7 @@ async fn main() -> anyhow::Result<()> {
update_builder.chunk_compression_type(indexer_opt_cloned.chunk_compression_type); update_builder.chunk_compression_type(indexer_opt_cloned.chunk_compression_type);
update_builder.chunk_fusing_shrink_size(indexer_opt_cloned.chunk_fusing_shrink_size.get_bytes()); update_builder.chunk_fusing_shrink_size(indexer_opt_cloned.chunk_fusing_shrink_size.get_bytes());
let before_update = Instant::now();
// we extract the update type and execute the update itself. // we extract the update type and execute the update itself.
let result: anyhow::Result<()> = match meta { let result: anyhow::Result<()> = match meta {
UpdateMeta::DocumentsAddition { method, format, encoding } => { UpdateMeta::DocumentsAddition { method, format, encoding } => {
@ -456,7 +457,7 @@ async fn main() -> anyhow::Result<()> {
}; };
let meta = match result { let meta = match result {
Ok(()) => format!("valid update content"), Ok(()) => format!("valid update content processed in {:.02?}", before_update.elapsed()),
Err(e) => format!("error while processing update content: {:?}", e), Err(e) => format!("error while processing update content: {:?}", e),
}; };