Add richer logging across workloads

This commit is contained in:
andrussal 2025-12-11 08:32:06 +01:00
parent b9ceca4182
commit ae6cf1ef0f
4 changed files with 22 additions and 5 deletions

View File

@ -69,9 +69,12 @@ impl RandomRestartWorkload {
.unwrap_or_else(|| Duration::from_millis(1))
.as_secs_f64();
let offset = thread_rng().gen_range(0.0..=spread);
self.min_delay
let delay = self
.min_delay
.checked_add(Duration::from_secs_f64(offset))
.unwrap_or(self.max_delay)
.unwrap_or(self.max_delay);
tracing::debug!(delay_ms = delay.as_millis(), "chaos restart selected delay");
delay
}
fn initialize_cooldowns(&self, targets: &[Target]) -> HashMap<Target, Instant> {
@ -99,6 +102,10 @@ impl RandomRestartWorkload {
{
let wait = next_ready.saturating_duration_since(now);
if !wait.is_zero() {
tracing::debug!(
wait_ms = wait.as_millis(),
"chaos restart waiting for cooldown"
);
sleep(wait).await;
continue;
}
@ -111,6 +118,7 @@ impl RandomRestartWorkload {
.collect();
if let Some(choice) = available.choose(&mut thread_rng()).copied() {
tracing::debug!(?choice, "chaos restart picked target");
return choice;
}
@ -174,7 +182,7 @@ impl Workload for RandomRestartWorkload {
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
enum Target {
Validator(usize),
Executor(usize),

View File

@ -86,8 +86,13 @@ impl Expectation for DaWorkloadExpectation {
&inscriptions_for_task,
&blobs_for_task,
),
Err(broadcast::error::RecvError::Lagged(_)) => {}
Err(broadcast::error::RecvError::Closed) => break,
Err(broadcast::error::RecvError::Lagged(skipped)) => {
tracing::debug!(skipped, "DA expectation: receiver lagged");
}
Err(broadcast::error::RecvError::Closed) => {
tracing::debug!("DA expectation: block feed closed");
break;
}
}
}
});

View File

@ -74,6 +74,7 @@ impl ScenarioWorkload for Workload {
for channel_id in self.plan().iter().copied() {
tracing::info!(channel_id = ?channel_id, "DA workload starting channel flow");
run_channel_flow(ctx, &mut receiver, channel_id).await?;
tracing::info!(channel_id = ?channel_id, "DA workload finished channel flow");
}
tracing::info!("DA workload completed all channel flows");

View File

@ -104,6 +104,7 @@ impl Expectation for TxInclusionExpectation {
tokio::spawn(async move {
let mut receiver = receiver;
let genesis_parent = HeaderId::from([0; 32]);
tracing::debug!("tx inclusion capture task started");
loop {
match receiver.recv().await {
Ok(record) => {
@ -115,6 +116,7 @@ impl Expectation for TxInclusionExpectation {
for note in &tx.mantle_tx().ledger_tx.outputs {
if spawn_accounts.contains(&note.pk) {
spawn_observed.fetch_add(1, Ordering::Relaxed);
tracing::debug!(pk = ?note.pk, "tx inclusion observed account output");
break;
}
}
@ -124,6 +126,7 @@ impl Expectation for TxInclusionExpectation {
Err(broadcast::error::RecvError::Closed) => break,
}
}
tracing::debug!("tx inclusion capture task exiting");
});
self.capture_state = Some(CaptureState {