From f31aa99c0eafd6ab91de73f7b33ea364b6540b52 Mon Sep 17 00:00:00 2001 From: andrussal Date: Thu, 11 Dec 2025 07:57:21 +0100 Subject: [PATCH] Add workload logging --- .../workflows/src/builder/mod.rs | 11 +++++++++++ .../workflows/src/workloads/da/workload.rs | 5 +++++ .../src/workloads/transaction/workload.rs | 19 +++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/testing-framework/workflows/src/builder/mod.rs b/testing-framework/workflows/src/builder/mod.rs index bc250a6..3609e72 100644 --- a/testing-framework/workflows/src/builder/mod.rs +++ b/testing-framework/workflows/src/builder/mod.rs @@ -143,6 +143,11 @@ impl TransactionFlowBuilder { let workload = transaction::Workload::with_rate(self.rate.get()) .expect("transaction rate must be non-zero") .with_user_limit(self.users); + tracing::info!( + rate = self.rate.get(), + users = self.users.map(|u| u.get()), + "attaching transaction workload" + ); self.builder = self.builder.with_workload(workload); self.builder } @@ -204,6 +209,12 @@ impl DataAvailabilityFlowBuilder { pub fn apply(mut self) -> CoreScenarioBuilder { let count = (self.channel_rate.get() * self.blob_rate.get()) as usize; let workload = da::Workload::with_channel_count(count.max(1)); + tracing::info!( + channel_rate = self.channel_rate.get(), + blob_rate = self.blob_rate.get(), + channels = count.max(1), + "attaching data-availability workload" + ); self.builder = self.builder.with_workload(workload); self.builder } diff --git a/testing-framework/workflows/src/workloads/da/workload.rs b/testing-framework/workflows/src/workloads/da/workload.rs index 3b215f9..6af491e 100644 --- a/testing-framework/workflows/src/workloads/da/workload.rs +++ b/testing-framework/workflows/src/workloads/da/workload.rs @@ -72,9 +72,11 @@ impl ScenarioWorkload for Workload { let mut receiver = ctx.block_feed().subscribe(); 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!("DA workload completed all channel flows"); Ok(()) } } @@ -84,11 +86,14 @@ async fn run_channel_flow( receiver: &mut broadcast::Receiver>, channel_id: ChannelId, ) -> Result<(), DynError> { + tracing::debug!(channel_id = ?channel_id, "DA: submitting inscription tx"); let tx = Arc::new(tx::create_inscription_transaction_with_id(channel_id)); submit_transaction_via_cluster(ctx, Arc::clone(&tx)).await?; let inscription_id = wait_for_inscription(receiver, channel_id).await?; + tracing::debug!(channel_id = ?channel_id, inscription_id = ?inscription_id, "DA: inscription observed"); let blob_id = publish_blob(ctx, channel_id, inscription_id).await?; + tracing::debug!(channel_id = ?channel_id, blob_id = ?blob_id, "DA: blob published"); wait_for_blob(receiver, channel_id, blob_id).await?; Ok(()) } diff --git a/testing-framework/workflows/src/workloads/transaction/workload.rs b/testing-framework/workflows/src/workloads/transaction/workload.rs index 16526e1..307b7b5 100644 --- a/testing-framework/workflows/src/workloads/transaction/workload.rs +++ b/testing-framework/workflows/src/workloads/transaction/workload.rs @@ -51,6 +51,7 @@ impl ScenarioWorkload for Workload { descriptors: &GeneratedTopology, _run_metrics: &RunMetrics, ) -> Result<(), DynError> { + tracing::info!("initializing transaction workload"); let wallet_accounts = descriptors.config().wallet().accounts.clone(); if wallet_accounts.is_empty() { return Err("transaction workload requires seeded accounts".into()); @@ -81,11 +82,22 @@ impl ScenarioWorkload for Workload { ); } + tracing::info!( + available_accounts = accounts.len(), + user_limit = self.user_limit.map(|u| u.get()), + "transaction workload accounts prepared" + ); + self.accounts = accounts; Ok(()) } async fn start(&self, ctx: &RunContext) -> Result<(), DynError> { + tracing::info!( + txs_per_block = self.txs_per_block.get(), + users = self.user_limit.map(|u| u.get()), + "starting transaction workload submission" + ); Submission::new(self, ctx)?.execute().await } } @@ -158,6 +170,12 @@ impl<'a> Submission<'a> { } async fn execute(mut self) -> Result<(), DynError> { + let total = self.plan.len(); + tracing::info!( + total, + interval_ms = self.interval.as_millis(), + "begin transaction submissions" + ); while let Some(input) = self.plan.pop_front() { submit_wallet_transaction(self.ctx, &input).await?; @@ -165,6 +183,7 @@ impl<'a> Submission<'a> { sleep(self.interval).await; } } + tracing::info!("transaction submissions finished"); Ok(()) }