log timings

This commit is contained in:
GroovieGermanikus 2023-12-21 14:19:49 +01:00
parent cbf7590d7b
commit a7e08f72c3
No known key found for this signature in database
GPG Key ID: 5B6EB831A5CD2015
1 changed files with 11 additions and 5 deletions

View File

@ -3,6 +3,7 @@ use std::{
time::Duration,
};
use std::cmp::min;
use std::time::Instant;
use anyhow::Context;
use base64::Engine;
@ -845,39 +846,44 @@ impl PostgresSession {
}
{
let started = Instant::now();
let deleted_rows = self.client.execute(
&format!(
r"
DELETE FROM banking_stage_results_2.transactions WHERE transaction_id <= {transaction_id}
", transaction_id = cutoff_transaction_incl
), &[]).await.unwrap();
info!("Deleted {} rows from transactions", deleted_rows);
info!("Deleted {} rows from transactions in {:.2}ms", deleted_rows, started.elapsed().as_secs_f32());
}
{
let started = Instant::now();
let deleted_rows = self.client.execute(
&format!(
r"
DELETE FROM banking_stage_results_2.accounts_map_transaction WHERE transaction_id <= {transaction_id}
", transaction_id = cutoff_transaction_incl
), &[]).await.unwrap();
info!("Deleted {} rows from accounts_map_transaction", deleted_rows);
info!("Deleted {} rows from accounts_map_transaction in {:.2}ms", deleted_rows, started.elapsed().as_secs_f32());
}
{
let started = Instant::now();
let deleted_rows = self.client.execute(
&format!(
r"
DELETE FROM banking_stage_results_2.transaction_infos WHERE processed_slot < {cutoff_slot}
", cutoff_slot = cutoff_slot_excl
), &[]).await.unwrap();
info!("Deleted {} rows from transaction_infos", deleted_rows);
}{
info!("Deleted {} rows from transaction_infos in {:.2}ms", deleted_rows, started.elapsed().as_secs_f32());
}
{
let started = Instant::now();
let deleted_rows = self.client.execute(
&format!(
r"
DELETE FROM banking_stage_results_2.transaction_slot WHERE slot < {cutoff_slot}
", cutoff_slot = cutoff_slot_excl
), &[]).await.unwrap();
info!("Deleted {} rows from transaction_slot", deleted_rows);
info!("Deleted {} rows from transaction_slot in {:.2}ms", deleted_rows, started.elapsed().as_secs_f32());
}
{