refactor: track future execution (#2014)

* refactor: track future execution

* refactor: update server/src/db/lifecycle/compact.rs

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
pull/24376/head
Edd Robinson 2021-07-15 21:58:52 +01:00 committed by GitHub
parent 74b8bb76e6
commit d5dcb40438
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -71,6 +71,7 @@ pub(crate) fn compact_chunks(
let ctx = db.exec.new_context(ExecutorType::Reorg);
let fut = async move {
let fut_now = std::time::Instant::now();
let key = compute_sort_key(query_chunks.iter().map(|x| x.summary()));
let key_str = format!("\"{}\"", key); // for logging
@ -108,7 +109,8 @@ pub(crate) fn compact_chunks(
info!(input_chunks=query_chunks.len(), rub_row_groups=rb_row_groups,
input_rows=input_rows, output_rows=guard.table_summary().count(),
sort_key=%key_str, compaction_took = ?elapsed, rows_per_sec=?throughput, "chunk(s) compacted");
sort_key=%key_str, compaction_took = ?elapsed, fut_execution_duration= ?fut_now.elapsed(),
rows_per_sec=?throughput, "chunk(s) compacted");
Ok(DbChunk::snapshot(&guard))
};